Mohammad Saadati - 810198410
The goal of this computer assignment is review the data set of COVID-19, pre-processing, illustration and express our analysis based on the illustrations performed. This data set have information about patients, new tests, patient deaths and some features related to countries are given separately by day.
First of all, we import necessary libraries to use their functions.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import math
import jdatetime
import datetime
import seaborn as sns
import datetime as dt
import plotly.express as px
import geopandas
Pre-processing is one of the most important steps in data mining projects. Various approaches are used in the field of lost data management and data conversion to other formats, and the careful selection of these approaches has a direct impact on the quality of the final results; Therefore, the best approach should always be identified and applied.
First we load csv file as a DataFrame using pandas library.
df = pd.read_csv("CA1_Dataset.csv")
df
| iso_code | continent | location | date | total_cases | new_cases | new_cases_smoothed | total_deaths | new_deaths | new_deaths_smoothed | ... | female_smokers | male_smokers | handwashing_facilities | hospital_beds_per_thousand | life_expectancy | human_development_index | excess_mortality_cumulative_absolute | excess_mortality_cumulative | excess_mortality | excess_mortality_cumulative_per_million | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | AFG | Asia | Afghanistan | 2020-02-24 | 5.0 | 5.0 | NaN | NaN | NaN | NaN | ... | NaN | NaN | 37.746 | 0.5 | 64.83 | 0.511 | NaN | NaN | NaN | NaN |
| 1 | AFG | Asia | Afghanistan | 2020-02-25 | 5.0 | 0.0 | NaN | NaN | NaN | NaN | ... | NaN | NaN | 37.746 | 0.5 | 64.83 | 0.511 | NaN | NaN | NaN | NaN |
| 2 | AFG | Asia | Afghanistan | 2020-02-26 | 5.0 | 0.0 | NaN | NaN | NaN | NaN | ... | NaN | NaN | 37.746 | 0.5 | 64.83 | 0.511 | NaN | NaN | NaN | NaN |
| 3 | AFG | Asia | Afghanistan | 2020-02-27 | 5.0 | 0.0 | NaN | NaN | NaN | NaN | ... | NaN | NaN | 37.746 | 0.5 | 64.83 | 0.511 | NaN | NaN | NaN | NaN |
| 4 | AFG | Asia | Afghanistan | 2020-02-28 | 5.0 | 0.0 | NaN | NaN | NaN | NaN | ... | NaN | NaN | 37.746 | 0.5 | 64.83 | 0.511 | NaN | NaN | NaN | NaN |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 165631 | ZWE | Africa | Zimbabwe | 2022-02-26 | 235803.0 | 336.0 | 368.429 | 5393.0 | 1.0 | 1.000 | ... | 1.6 | 30.7 | 36.791 | 1.7 | 61.49 | 0.571 | NaN | NaN | NaN | NaN |
| 165632 | ZWE | Africa | Zimbabwe | 2022-02-27 | 235803.0 | 0.0 | 350.143 | 5393.0 | 0.0 | 1.000 | ... | 1.6 | 30.7 | 36.791 | 1.7 | 61.49 | 0.571 | NaN | NaN | NaN | NaN |
| 165633 | ZWE | Africa | Zimbabwe | 2022-02-28 | 236380.0 | 577.0 | 401.286 | 5395.0 | 2.0 | 1.286 | ... | 1.6 | 30.7 | 36.791 | 1.7 | 61.49 | 0.571 | NaN | NaN | NaN | NaN |
| 165634 | ZWE | Africa | Zimbabwe | 2022-03-01 | 236871.0 | 491.0 | 413.000 | 5395.0 | 0.0 | 1.000 | ... | 1.6 | 30.7 | 36.791 | 1.7 | 61.49 | 0.571 | NaN | NaN | NaN | NaN |
| 165635 | ZWE | Africa | Zimbabwe | 2022-03-02 | 237503.0 | 632.0 | 416.286 | 5396.0 | 1.0 | 1.143 | ... | 1.6 | 30.7 | 36.791 | 1.7 | 61.49 | 0.571 | NaN | NaN | NaN | NaN |
165636 rows × 67 columns
In this part first we use two Pandas function (isna and sum) to count number of missing values at each column.
df.info()
pd.set_option('display.max_rows',None)
df.isna().sum()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 165636 entries, 0 to 165635 Data columns (total 67 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 iso_code 165636 non-null object 1 continent 155719 non-null object 2 location 165636 non-null object 3 date 165636 non-null object 4 total_cases 162606 non-null float64 5 new_cases 162464 non-null float64 6 new_cases_smoothed 160480 non-null float64 7 total_deaths 144793 non-null float64 8 new_deaths 144833 non-null float64 9 new_deaths_smoothed 142734 non-null float64 10 total_cases_per_million 161851 non-null float64 11 new_cases_per_million 161709 non-null float64 12 new_cases_smoothed_per_million 159731 non-null float64 13 total_deaths_per_million 144051 non-null float64 14 new_deaths_per_million 144091 non-null float64 15 new_deaths_smoothed_per_million 141998 non-null float64 16 reproduction_rate 125067 non-null float64 17 icu_patients 23390 non-null float64 18 icu_patients_per_million 23390 non-null float64 19 hosp_patients 24564 non-null float64 20 hosp_patients_per_million 24564 non-null float64 21 weekly_icu_admissions 5404 non-null float64 22 weekly_icu_admissions_per_million 5404 non-null float64 23 weekly_hosp_admissions 10877 non-null float64 24 weekly_hosp_admissions_per_million 10877 non-null float64 25 new_tests 67006 non-null float64 26 total_tests 68944 non-null float64 27 total_tests_per_thousand 68944 non-null float64 28 new_tests_per_thousand 67006 non-null float64 29 new_tests_smoothed 83658 non-null float64 30 new_tests_smoothed_per_thousand 83658 non-null float64 31 positive_rate 78590 non-null float64 32 tests_per_case 78027 non-null float64 33 tests_units 85981 non-null object 34 total_vaccinations 44978 non-null float64 35 people_vaccinated 42792 non-null float64 36 people_fully_vaccinated 40028 non-null float64 37 total_boosters 17340 non-null float64 38 new_vaccinations 37252 non-null float64 39 new_vaccinations_smoothed 84112 non-null float64 40 total_vaccinations_per_hundred 44978 non-null float64 41 people_vaccinated_per_hundred 42792 non-null float64 42 people_fully_vaccinated_per_hundred 40028 non-null float64 43 total_boosters_per_hundred 17340 non-null float64 44 new_vaccinations_smoothed_per_million 84112 non-null float64 45 new_people_vaccinated_smoothed 82821 non-null float64 46 new_people_vaccinated_smoothed_per_hundred 82821 non-null float64 47 stringency_index 129862 non-null float64 48 population 164564 non-null float64 49 population_density 147313 non-null float64 50 median_age 137258 non-null float64 51 aged_65_older 135770 non-null float64 52 aged_70_older 136522 non-null float64 53 gdp_per_capita 137928 non-null float64 54 extreme_poverty 90837 non-null float64 55 cardiovasc_death_rate 136208 non-null float64 56 diabetes_prevalence 143349 non-null float64 57 female_smokers 105609 non-null float64 58 male_smokers 104160 non-null float64 59 handwashing_facilities 68284 non-null float64 60 hospital_beds_per_thousand 123151 non-null float64 61 life_expectancy 154620 non-null float64 62 human_development_index 135683 non-null float64 63 excess_mortality_cumulative_absolute 5696 non-null float64 64 excess_mortality_cumulative 5696 non-null float64 65 excess_mortality 5696 non-null float64 66 excess_mortality_cumulative_per_million 5696 non-null float64 dtypes: float64(62), object(5) memory usage: 84.7+ MB
iso_code 0 continent 9917 location 0 date 0 total_cases 3030 new_cases 3172 new_cases_smoothed 5156 total_deaths 20843 new_deaths 20803 new_deaths_smoothed 22902 total_cases_per_million 3785 new_cases_per_million 3927 new_cases_smoothed_per_million 5905 total_deaths_per_million 21585 new_deaths_per_million 21545 new_deaths_smoothed_per_million 23638 reproduction_rate 40569 icu_patients 142246 icu_patients_per_million 142246 hosp_patients 141072 hosp_patients_per_million 141072 weekly_icu_admissions 160232 weekly_icu_admissions_per_million 160232 weekly_hosp_admissions 154759 weekly_hosp_admissions_per_million 154759 new_tests 98630 total_tests 96692 total_tests_per_thousand 96692 new_tests_per_thousand 98630 new_tests_smoothed 81978 new_tests_smoothed_per_thousand 81978 positive_rate 87046 tests_per_case 87609 tests_units 79655 total_vaccinations 120658 people_vaccinated 122844 people_fully_vaccinated 125608 total_boosters 148296 new_vaccinations 128384 new_vaccinations_smoothed 81524 total_vaccinations_per_hundred 120658 people_vaccinated_per_hundred 122844 people_fully_vaccinated_per_hundred 125608 total_boosters_per_hundred 148296 new_vaccinations_smoothed_per_million 81524 new_people_vaccinated_smoothed 82815 new_people_vaccinated_smoothed_per_hundred 82815 stringency_index 35774 population 1072 population_density 18323 median_age 28378 aged_65_older 29866 aged_70_older 29114 gdp_per_capita 27708 extreme_poverty 74799 cardiovasc_death_rate 29428 diabetes_prevalence 22287 female_smokers 60027 male_smokers 61476 handwashing_facilities 97352 hospital_beds_per_thousand 42485 life_expectancy 11016 human_development_index 29953 excess_mortality_cumulative_absolute 159940 excess_mortality_cumulative 159940 excess_mortality 159940 excess_mortality_cumulative_per_million 159940 dtype: int64
Now use fillna function to fill out the missing values in the given column.
To fill in the missing values in numeric columns:
To fill in the missing values in the continent column:
To fill in the missing values in the tests_units column:
Note: for tests_units column, at first we tried to fill in the missing values with the corresponding location mode, but since it took a long time, we did not do this method.
unique_continent = df['continent'].unique()
for column in df:
if df[column].isna().sum() > 0:
if df[column].dtypes != object:
if column[0] == 't' or column[0] == 'n':
df[column].fillna(0, inplace=True)
elif df[column].isna().sum() / df.shape[0] > 0.9:
df[column].fillna(-np.inf, inplace=True)
else:
df[column].fillna(df[column].mean(), inplace=True)
elif column == "continent":
df['continent'] = df.apply(lambda row: row['location'] if (pd.isna(row['continent']) and (row['location'] in unique_continent))
else ('Undefined' if pd.isna(row['continent']) else row['continent']) , axis=1)
elif column == "tests_units":
df['tests_units'].fillna(df['tests_units'].mode()[0], inplace=True)
# df['tests_units'] = df.apply( lambda row : df['tests_units'].mode()[0] if (df[df['location'] == row['location']]['tests_units'].isnull().values.all())
# else (df[df['location'] == row['location']]['tests_units'].mode()[0] if pd.isna(row['tests_units'])
# else row['tests_units']), axis = 1)
#df.to_csv("df_p1_q1.csv")
df.isna().sum()
iso_code 0 continent 0 location 0 date 0 total_cases 0 new_cases 0 new_cases_smoothed 0 total_deaths 0 new_deaths 0 new_deaths_smoothed 0 total_cases_per_million 0 new_cases_per_million 0 new_cases_smoothed_per_million 0 total_deaths_per_million 0 new_deaths_per_million 0 new_deaths_smoothed_per_million 0 reproduction_rate 0 icu_patients 0 icu_patients_per_million 0 hosp_patients 0 hosp_patients_per_million 0 weekly_icu_admissions 0 weekly_icu_admissions_per_million 0 weekly_hosp_admissions 0 weekly_hosp_admissions_per_million 0 new_tests 0 total_tests 0 total_tests_per_thousand 0 new_tests_per_thousand 0 new_tests_smoothed 0 new_tests_smoothed_per_thousand 0 positive_rate 0 tests_per_case 0 tests_units 0 total_vaccinations 0 people_vaccinated 0 people_fully_vaccinated 0 total_boosters 0 new_vaccinations 0 new_vaccinations_smoothed 0 total_vaccinations_per_hundred 0 people_vaccinated_per_hundred 0 people_fully_vaccinated_per_hundred 0 total_boosters_per_hundred 0 new_vaccinations_smoothed_per_million 0 new_people_vaccinated_smoothed 0 new_people_vaccinated_smoothed_per_hundred 0 stringency_index 0 population 0 population_density 0 median_age 0 aged_65_older 0 aged_70_older 0 gdp_per_capita 0 extreme_poverty 0 cardiovasc_death_rate 0 diabetes_prevalence 0 female_smokers 0 male_smokers 0 handwashing_facilities 0 hospital_beds_per_thousand 0 life_expectancy 0 human_development_index 0 excess_mortality_cumulative_absolute 0 excess_mortality_cumulative 0 excess_mortality 0 excess_mortality_cumulative_per_million 0 dtype: int64
Missing values in your data do not reduce your sample size, as it would be the case with listwise deletion (the default of many statistical software packages, e.g. R, Stata, SAS or SPSS). Since mean imputation replaces all missing values, you can keep your whole database.
Replacing missing data by the mean of nonmissing data causes the population SD to be underestimated, but may also obscure important features of the population from which the data were sampled. Another possible disadvantage with using the mean for missing values is that the reason the values are missing in the first place could be dependent on the missing values themselves. (This is called missing not at random.)
Advantages : Easy to apply - Mean will not change
Disadvantages : Results may not be accurate - For large amount of NaN data this method can increase mod value significantly and cause error in results - The variance will decrease
In this section, in a new dataframe called df_p1_q2, we calculate the number of new_cases, the number of new_vaccinations, the number of new_deaths and the population for each country aggregated.
We use the groupby function to aggregate. We use sum() method to aggregate the new columns and max() method to aggregate the total columns
pd.reset_option('display.max_rows')
df_p1_q2 = df[["location", "new_cases", "new_vaccinations", "new_deaths"]]
df_p1_q2 = df_p1_q2.groupby(by="location").sum()
df_p1_q2_p = df[["location", "population"]]
df_p1_q2_p = df_p1_q2_p.groupby(by="location").max()
df_p1_q2 = df_p1_q2.join(df_p1_q2_p)
df_p1_q2
| new_cases | new_vaccinations | new_deaths | population | |
|---|---|---|---|---|
| location | ||||
| Afghanistan | 174081.0 | 1.374200e+04 | 7617.0 | 3.983543e+07 |
| Africa | 11230524.0 | 5.818190e+08 | 248668.0 | 1.373486e+09 |
| Albania | 271825.0 | 1.415150e+06 | 3474.0 | 2.872934e+06 |
| Algeria | 265079.0 | 1.707860e+05 | 6843.0 | 4.461663e+07 |
| Andorra | 38249.0 | 4.802000e+03 | 151.0 | 7.735400e+04 |
| ... | ... | ... | ... | ... |
| Wallis and Futuna | 454.0 | 0.000000e+00 | 7.0 | 1.109400e+04 |
| World | 439011701.0 | 1.122516e+10 | 5946817.0 | 7.874966e+09 |
| Yemen | 11772.0 | 0.000000e+00 | 2135.0 | 3.049064e+07 |
| Zambia | 313203.0 | 1.321156e+06 | 3955.0 | 1.892066e+07 |
| Zimbabwe | 237509.0 | 7.080893e+06 | 5396.0 | 1.509217e+07 |
238 rows × 4 columns
In this part we use jdatetime.date.fromgregorian function from jdatetime library to convert gregorian date to shamsi date and store the result in shamsi_date column of a new dataframe called df_p1_q3.
def convert_gregorian_date_to_shamsi_date(gregorian_date):
y, m , d = gregorian_date.split("-")
return str(jdatetime.date.fromgregorian(day=int(d),month=int(m),year=int(y)))
df['shamsi_date'] = df['date']
for index, row in df.iterrows():
shamsi_date = convert_gregorian_date_to_shamsi_date(row['shamsi_date'])
df.at[index,'shamsi_date'] = shamsi_date
#df.to_csv("df_p1_q3.csv")
df
| iso_code | continent | location | date | total_cases | new_cases | new_cases_smoothed | total_deaths | new_deaths | new_deaths_smoothed | ... | male_smokers | handwashing_facilities | hospital_beds_per_thousand | life_expectancy | human_development_index | excess_mortality_cumulative_absolute | excess_mortality_cumulative | excess_mortality | excess_mortality_cumulative_per_million | shamsi_date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | AFG | Asia | Afghanistan | 2020-02-24 | 5.0 | 5.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 32.778255 | 37.746 | 0.5 | 64.83 | 0.511 | -inf | -inf | -inf | -inf | 1398-12-05 |
| 1 | AFG | Asia | Afghanistan | 2020-02-25 | 5.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 32.778255 | 37.746 | 0.5 | 64.83 | 0.511 | -inf | -inf | -inf | -inf | 1398-12-06 |
| 2 | AFG | Asia | Afghanistan | 2020-02-26 | 5.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 32.778255 | 37.746 | 0.5 | 64.83 | 0.511 | -inf | -inf | -inf | -inf | 1398-12-07 |
| 3 | AFG | Asia | Afghanistan | 2020-02-27 | 5.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 32.778255 | 37.746 | 0.5 | 64.83 | 0.511 | -inf | -inf | -inf | -inf | 1398-12-08 |
| 4 | AFG | Asia | Afghanistan | 2020-02-28 | 5.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 32.778255 | 37.746 | 0.5 | 64.83 | 0.511 | -inf | -inf | -inf | -inf | 1398-12-09 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 165631 | ZWE | Africa | Zimbabwe | 2022-02-26 | 235803.0 | 336.0 | 368.429 | 5393.0 | 1.0 | 1.000 | ... | 30.700000 | 36.791 | 1.7 | 61.49 | 0.571 | -inf | -inf | -inf | -inf | 1400-12-07 |
| 165632 | ZWE | Africa | Zimbabwe | 2022-02-27 | 235803.0 | 0.0 | 350.143 | 5393.0 | 0.0 | 1.000 | ... | 30.700000 | 36.791 | 1.7 | 61.49 | 0.571 | -inf | -inf | -inf | -inf | 1400-12-08 |
| 165633 | ZWE | Africa | Zimbabwe | 2022-02-28 | 236380.0 | 577.0 | 401.286 | 5395.0 | 2.0 | 1.286 | ... | 30.700000 | 36.791 | 1.7 | 61.49 | 0.571 | -inf | -inf | -inf | -inf | 1400-12-09 |
| 165634 | ZWE | Africa | Zimbabwe | 2022-03-01 | 236871.0 | 491.0 | 413.000 | 5395.0 | 0.0 | 1.000 | ... | 30.700000 | 36.791 | 1.7 | 61.49 | 0.571 | -inf | -inf | -inf | -inf | 1400-12-10 |
| 165635 | ZWE | Africa | Zimbabwe | 2022-03-02 | 237503.0 | 632.0 | 416.286 | 5396.0 | 1.0 | 1.143 | ... | 30.700000 | 36.791 | 1.7 | 61.49 | 0.571 | -inf | -inf | -inf | -inf | 1400-12-11 |
165636 rows × 68 columns
Yes, for example, you can ignore the total column and replace the aggregate values of the new columns with the total column.
Redundant attributes may be able to be detected by correlation analysis and covariance analysis
df.corr()
| total_cases | new_cases | new_cases_smoothed | total_deaths | new_deaths | new_deaths_smoothed | total_cases_per_million | new_cases_per_million | new_cases_smoothed_per_million | total_deaths_per_million | ... | female_smokers | male_smokers | handwashing_facilities | hospital_beds_per_thousand | life_expectancy | human_development_index | excess_mortality_cumulative_absolute | excess_mortality_cumulative | excess_mortality | excess_mortality_cumulative_per_million | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| total_cases | 1.000000 | 0.806677 | 0.827899 | 0.968956 | 0.726685 | 0.747316 | 0.104767 | 0.032705 | 0.043368 | 0.137671 | ... | -0.002716 | -0.005809 | 0.025074 | -0.004761 | 0.010728 | 0.029702 | 0.802190 | 0.139572 | 0.034064 | 0.228241 |
| new_cases | 0.806677 | 1.000000 | 0.976958 | 0.735240 | 0.668096 | 0.654269 | 0.097389 | 0.088765 | 0.098912 | 0.103075 | ... | 0.002898 | -0.001433 | 0.020072 | 0.002557 | 0.012515 | 0.028335 | 0.464078 | 0.090745 | 0.092382 | 0.124742 |
| new_cases_smoothed | 0.827899 | 0.976958 | 1.000000 | 0.749612 | 0.663865 | 0.673995 | 0.101359 | 0.078399 | 0.101462 | 0.105567 | ... | 0.002698 | -0.001564 | 0.020375 | 0.002142 | 0.012423 | 0.028472 | 0.509117 | 0.075321 | 0.070259 | 0.127365 |
| total_deaths | 0.968956 | 0.735240 | 0.749612 | 1.000000 | 0.781224 | 0.803281 | 0.085529 | 0.017392 | 0.022912 | 0.156600 | ... | -0.006089 | -0.006023 | 0.030088 | -0.006634 | 0.010865 | 0.030726 | 0.928284 | 0.338096 | 0.110488 | 0.370520 |
| new_deaths | 0.726685 | 0.668096 | 0.663865 | 0.781224 | 1.000000 | 0.975575 | 0.031455 | 0.016238 | 0.017744 | 0.085165 | ... | -0.006418 | -0.000462 | 0.032785 | -0.003287 | 0.009868 | 0.032106 | 0.493040 | 0.301056 | 0.395089 | 0.193819 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| human_development_index | 0.029702 | 0.028335 | 0.028472 | 0.030726 | 0.032106 | 0.032645 | 0.343099 | 0.158589 | 0.199781 | 0.326067 | ... | 0.483810 | 0.082491 | 0.447246 | 0.468142 | 0.847106 | 1.000000 | -0.102242 | -0.347135 | -0.290497 | -0.231463 |
| excess_mortality_cumulative_absolute | 0.802190 | 0.464078 | 0.509117 | 0.928284 | 0.493040 | 0.655323 | 0.169916 | 0.008444 | 0.018781 | 0.376935 | ... | -0.122511 | -0.115914 | 0.102151 | -0.168047 | -0.195392 | -0.102242 | 1.000000 | 0.397512 | 0.167042 | 0.445995 |
| excess_mortality_cumulative | 0.139572 | 0.090745 | 0.075321 | 0.338096 | 0.301056 | 0.254753 | 0.232222 | 0.057043 | 0.041999 | 0.651316 | ... | -0.261507 | -0.066339 | 0.203881 | -0.252829 | -0.253115 | -0.347135 | 0.397512 | 1.000000 | 0.551706 | 0.738794 |
| excess_mortality | 0.034064 | 0.092382 | 0.070259 | 0.110488 | 0.395089 | 0.322358 | 0.100555 | 0.118010 | 0.117073 | 0.264369 | ... | -0.119547 | 0.052966 | 0.145492 | -0.111678 | -0.257628 | -0.290497 | 0.167042 | 0.551706 | 1.000000 | 0.382483 |
| excess_mortality_cumulative_per_million | 0.228241 | 0.124742 | 0.127365 | 0.370520 | 0.193819 | 0.203090 | 0.553645 | 0.162462 | 0.182880 | 0.863743 | ... | 0.020326 | 0.117764 | 0.097386 | 0.007885 | -0.279109 | -0.231463 | 0.445995 | 0.738794 | 0.382483 | 1.000000 |
62 rows × 62 columns
Creating a new dataframe that has only information about Iran and we called it df_iran.
df_iran = df[df["iso_code"] == "IRN"]
df_iran
| iso_code | continent | location | date | total_cases | new_cases | new_cases_smoothed | total_deaths | new_deaths | new_deaths_smoothed | ... | male_smokers | handwashing_facilities | hospital_beds_per_thousand | life_expectancy | human_development_index | excess_mortality_cumulative_absolute | excess_mortality_cumulative | excess_mortality | excess_mortality_cumulative_per_million | shamsi_date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 71639 | IRN | Asia | Iran | 2020-02-19 | 2.0 | 2.0 | 0.000 | 2.0 | 2.0 | 0.000 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-11-30 |
| 71640 | IRN | Asia | Iran | 2020-02-20 | 5.0 | 3.0 | 0.000 | 2.0 | 0.0 | 0.000 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-12-01 |
| 71641 | IRN | Asia | Iran | 2020-02-21 | 18.0 | 13.0 | 0.000 | 4.0 | 2.0 | 0.000 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-12-02 |
| 71642 | IRN | Asia | Iran | 2020-02-22 | 28.0 | 10.0 | 0.000 | 5.0 | 1.0 | 0.000 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-12-03 |
| 71643 | IRN | Asia | Iran | 2020-02-23 | 43.0 | 15.0 | 0.000 | 8.0 | 3.0 | 0.000 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -2658.0 | -4.14 | 2.79 | -31.260011 | 1398-12-04 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 72377 | IRN | Asia | Iran | 2022-02-26 | 7030943.0 | 7039.0 | 15065.429 | 136390.0 | 224.0 | 227.429 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-07 |
| 72378 | IRN | Asia | Iran | 2022-02-27 | 7040467.0 | 9524.0 | 14002.143 | 136631.0 | 241.0 | 227.286 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-08 |
| 72379 | IRN | Asia | Iran | 2022-02-28 | 7051429.0 | 10962.0 | 12838.143 | 136838.0 | 207.0 | 223.143 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-09 |
| 72380 | IRN | Asia | Iran | 2022-03-01 | 7060741.0 | 9312.0 | 11015.143 | 137064.0 | 226.0 | 223.571 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-10 |
| 72381 | IRN | Asia | Iran | 2022-03-02 | 7066975.0 | 6234.0 | 9714.286 | 137267.0 | 203.0 | 220.143 | ... | 21.1 | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-11 |
743 rows × 68 columns
In this part, we will create a new column called shamsi_month for df_iran, which is considered as an independent feature in that month.
df_iran['shamsi_month'] = df_iran["shamsi_date"]
for index, row in df_iran.iterrows():
y, m , d = row['shamsi_date'].split("-")
df_iran.at[index,'shamsi_month'] = m
df_iran
/tmp/ipykernel_4500/4173350697.py:1: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy df_iran['shamsi_month'] = df_iran["shamsi_date"]
| iso_code | continent | location | date | total_cases | new_cases | new_cases_smoothed | total_deaths | new_deaths | new_deaths_smoothed | ... | handwashing_facilities | hospital_beds_per_thousand | life_expectancy | human_development_index | excess_mortality_cumulative_absolute | excess_mortality_cumulative | excess_mortality | excess_mortality_cumulative_per_million | shamsi_date | shamsi_month | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 71639 | IRN | Asia | Iran | 2020-02-19 | 2.0 | 2.0 | 0.000 | 2.0 | 2.0 | 0.000 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-11-30 | 11 |
| 71640 | IRN | Asia | Iran | 2020-02-20 | 5.0 | 3.0 | 0.000 | 2.0 | 0.0 | 0.000 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-12-01 | 12 |
| 71641 | IRN | Asia | Iran | 2020-02-21 | 18.0 | 13.0 | 0.000 | 4.0 | 2.0 | 0.000 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-12-02 | 12 |
| 71642 | IRN | Asia | Iran | 2020-02-22 | 28.0 | 10.0 | 0.000 | 5.0 | 1.0 | 0.000 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1398-12-03 | 12 |
| 71643 | IRN | Asia | Iran | 2020-02-23 | 43.0 | 15.0 | 0.000 | 8.0 | 3.0 | 0.000 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -2658.0 | -4.14 | 2.79 | -31.260011 | 1398-12-04 | 12 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 72377 | IRN | Asia | Iran | 2022-02-26 | 7030943.0 | 7039.0 | 15065.429 | 136390.0 | 224.0 | 227.429 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-07 | 12 |
| 72378 | IRN | Asia | Iran | 2022-02-27 | 7040467.0 | 9524.0 | 14002.143 | 136631.0 | 241.0 | 227.286 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-08 | 12 |
| 72379 | IRN | Asia | Iran | 2022-02-28 | 7051429.0 | 10962.0 | 12838.143 | 136838.0 | 207.0 | 223.143 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-09 | 12 |
| 72380 | IRN | Asia | Iran | 2022-03-01 | 7060741.0 | 9312.0 | 11015.143 | 137064.0 | 226.0 | 223.571 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-10 | 12 |
| 72381 | IRN | Asia | Iran | 2022-03-02 | 7066975.0 | 6234.0 | 9714.286 | 137267.0 | 203.0 | 220.143 | ... | 50.790872 | 1.5 | 76.68 | 0.783 | -inf | -inf | -inf | -inf | 1400-12-11 | 12 |
743 rows × 69 columns
In this part, we create a new dataframe that aggregates the Iranian dataframe by month in 2021 and called it df_p1_q7.
We use the groupby function to aggregate. We use sum() method to aggregate the new columns and max() method to aggregate the total columns
new_column = []
for column in df_iran:
if column[0] == 'n':
new_column.append(column)
new_column.append('shamsi_month')
df_iran_new_column = df_iran[new_column].copy()
new_column.pop()
df_iran_without_new_column = df_iran.copy()
df_iran_without_new_column.drop(new_column, axis = 1, inplace = True)
df_iran_without_new_column = df_iran_without_new_column.groupby(by="shamsi_month").max()
df_iran_new_column = df_iran_new_column.groupby(by="shamsi_month").sum()
df_p1_q7 = df_iran_without_new_column.join(df_iran_new_column)
#df_p1_q7.to_csv("df_p1_q7.csv")
df_p1_q7
| iso_code | continent | location | date | total_cases | total_deaths | total_cases_per_million | total_deaths_per_million | reproduction_rate | icu_patients | ... | new_deaths_smoothed_per_million | new_tests | new_tests_per_thousand | new_tests_smoothed | new_tests_smoothed_per_thousand | new_vaccinations | new_vaccinations_smoothed | new_vaccinations_smoothed_per_million | new_people_vaccinated_smoothed | new_people_vaccinated_smoothed_per_hundred | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| shamsi_month | |||||||||||||||||||||
| 01 | IRN | Asia | Iran | 2021-04-20 | 2286927.0 | 67525.0 | 26895.923 | 794.143 | 1.81 | 903.707952 | ... | 104.570 | 730425.0 | 8.592 | 2467835.0 | 29.022 | 71691.0 | 403349.0 | 4741.0 | 284774.0 | 0.339 |
| 02 | IRN | Asia | Iran | 2021-05-21 | 2815882.0 | 78194.0 | 33116.818 | 919.618 | 1.27 | 903.707952 | ... | 155.468 | 409622.0 | 4.817 | 4373639.0 | 51.435 | 129369.0 | 1937861.0 | 22790.0 | 1701185.0 | 2.002 |
| 03 | IRN | Asia | Iran | 2021-06-21 | 3105620.0 | 83101.0 | 36524.348 | 977.328 | 1.30 | 903.707952 | ... | 87.378 | 658679.0 | 7.744 | 4542917.0 | 53.426 | 0.0 | 2432576.0 | 28607.0 | 1897683.0 | 2.227 |
| 04 | IRN | Asia | Iran | 2021-07-22 | 3623840.0 | 88063.0 | 42618.992 | 1035.685 | 1.38 | 903.707952 | ... | 111.742 | 777132.0 | 9.138 | 3724340.0 | 43.798 | 0.0 | 3276433.0 | 38530.0 | 1884147.0 | 2.213 |
| 05 | IRN | Asia | Iran | 2021-08-22 | 4677114.0 | 102038.0 | 55006.259 | 1200.041 | 1.28 | 903.707952 | ... | 221.069 | 1245457.0 | 14.647 | 3250257.0 | 38.228 | 0.0 | 12940963.0 | 152194.0 | 10180866.0 | 11.972 |
| 06 | IRN | Asia | Iran | 2021-09-22 | 5477229.0 | 118191.0 | 64416.193 | 1390.012 | 1.26 | 903.707952 | ... | 246.029 | 3072546.0 | 36.135 | 4207928.0 | 49.488 | 2587215.0 | 21652513.0 | 254648.0 | 12837489.0 | 15.097 |
| 07 | IRN | Asia | Iran | 2021-10-22 | 5844589.0 | 124928.0 | 68736.613 | 1469.244 | 1.26 | 903.707952 | ... | 161.503 | 2017449.0 | 23.725 | 4040342.0 | 47.517 | 0.0 | 32477191.0 | 381956.0 | 20348580.0 | 23.934 |
| 08 | IRN | Asia | Iran | 2021-11-21 | 6077438.0 | 128956.0 | 71475.087 | 1516.616 | 1.32 | 903.707952 | ... | 190.918 | 2230156.0 | 26.230 | 4291678.0 | 50.474 | 0.0 | 25418375.0 | 298939.0 | 6997855.0 | 8.231 |
| 09 | IRN | Asia | Iran | 2021-12-21 | 6175782.0 | 131167.0 | 72631.684 | 1542.619 | 1.12 | 903.707952 | ... | 152.994 | 2279653.0 | 26.809 | 4520663.0 | 53.166 | 171719.0 | 12062583.0 | 141866.0 | 2785809.0 | 3.280 |
| 10 | IRN | Asia | Iran | 2022-01-20 | 6236567.0 | 132152.0 | 73346.559 | 1554.204 | 1.72 | 903.707952 | ... | 55.381 | 2630337.0 | 30.933 | 4428291.0 | 52.079 | 2717110.0 | 13690288.0 | 161008.0 | 1314004.0 | 1.543 |
| 11 | IRN | Asia | Iran | 2022-02-19 | 6925485.0 | 134798.0 | 81448.736 | 1585.322 | 2.38 | 903.707952 | ... | 52.618 | 1145796.0 | 13.473 | 4433371.0 | 52.143 | 8683000.0 | 12010588.0 | 141250.0 | 1461538.0 | 1.719 |
| 12 | IRN | Asia | Iran | 2022-03-02 | 7066975.0 | 137267.0 | 83112.761 | 1614.360 | 4.92 | 903.707952 | ... | 66.977 | 398263.0 | 4.684 | 2512695.0 | 29.553 | 2375342.0 | 2955310.0 | 34762.0 | 1089561.0 | 1.270 |
12 rows × 68 columns
One of the most used items in data mining is data visualization, which can be used to gain an understanding of the data set and also provide a complete analysis based on the obtained diagrams.
plt.rcParams["font.family"] = "serif"
In this section, using a bar chart, we identify the countries that have had the best and worst performance (number of deaths relative to the total population) in controlling the corona virus.
df_p2_q1 = df_p1_q2.copy()
df_p2_q1['deaths_per_pop'] = df_p1_q2['new_deaths'] / df_p1_q2['population']
df_p2_q1 = df_p2_q1.sort_values(by= ['deaths_per_pop'], ascending= [False])
plt.figure(figsize=(200,40))
ax = sns.barplot(df_p2_q1.index, df_p2_q1['deaths_per_pop'] , alpha=0.8, color='r')
ax.set_title("Performance in Inhibiting Corona Virus",fontsize=25)
ax.set_xlabel('Location',fontsize=25)
ax.set_ylabel('Performance',fontsize=25)
ax.set_xticklabels(df_p2_q1.index, rotation='vertical', fontsize=25)
plt.xticks(rotation = 80)
plt.show()
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation. warnings.warn(
The Peru, Bulgaria, Bosnia and Herzegovina, Hungary and North Macedonia countries have had the best performance in controlling the corona virus.
The Jersey ,Samoa ,Falkland Islands, Guernsey and Tonga countries have had the worst performance in controlling the corona virus.
In this part, we want to investigate the effect of vaccination on the number of deaths. To do this, for each country, we calculate the number of new_vaccinations per population of that country, and after sorting the obtained values, we select one country out of every fifth one for review and comparison.
pd.set_option('display.max_rows',None)
df_p2_q2= df_p1_q2.copy()
df_p2_q2['ratio1'] = (df_p2_q2['new_vaccinations'] / df_p2_q2['population'])
df_p2_q2['ratio2'] = (df_p2_q2['new_deaths'] / df_p2_q2['population'])
df_p2_q2 = df_p2_q2.sort_values(by=['ratio1'], ascending= [False])
df_p2_q2
| new_cases | new_vaccinations | new_deaths | population | ratio1 | ratio2 | |
|---|---|---|---|---|---|---|
| location | ||||||
| Cuba | 1070730.0 | 3.065243e+07 | 8497.0 | 1.131750e+07 | 2.708410 | 7.507843e-04 |
| Gibraltar | 15632.0 | 8.906400e+04 | 101.0 | 3.369100e+04 | 2.643555 | 2.997833e-03 |
| Chile | 3098110.0 | 4.855777e+07 | 42624.0 | 1.921236e+07 | 2.527423 | 2.218572e-03 |
| Singapore | 767663.0 | 1.357254e+07 | 1040.0 | 5.453600e+06 | 2.488730 | 1.906997e-04 |
| Malta | 71497.0 | 1.205547e+06 | 608.0 | 5.161000e+05 | 2.335879 | 1.178066e-03 |
| South Korea | 3691487.0 | 1.192514e+08 | 8394.0 | 5.130518e+07 | 2.324354 | 1.636092e-04 |
| Denmark | 2805858.0 | 1.317204e+07 | 4633.0 | 5.813302e+06 | 2.265845 | 7.969653e-04 |
| Italy | 12868066.0 | 1.343115e+08 | 155245.0 | 6.036747e+07 | 2.224899 | 2.571666e-03 |
| Uruguay | 846889.0 | 7.622054e+06 | 7005.0 | 3.485152e+06 | 2.187008 | 2.009955e-03 |
| Belgium | 3563841.0 | 2.504046e+07 | 30316.0 | 1.163233e+07 | 2.152660 | 2.606184e-03 |
| Canada | 3303284.0 | 8.106477e+07 | 36728.0 | 3.806791e+07 | 2.129478 | 9.648020e-04 |
| Ireland | 1315500.0 | 1.056764e+07 | 6540.0 | 4.982904e+06 | 2.120779 | 1.312488e-03 |
| China | 109423.0 | 3.061013e+09 | 4640.0 | 1.444216e+09 | 2.119498 | 3.212816e-06 |
| France | 23316777.0 | 1.408496e+08 | 138537.0 | 6.742200e+07 | 2.089075 | 2.054774e-03 |
| Australia | 3326214.0 | 5.379783e+07 | 5319.0 | 2.578822e+07 | 2.086140 | 2.062570e-04 |
| New Zealand | 166103.0 | 1.067335e+07 | 56.0 | 5.126300e+06 | 2.082077 | 1.092406e-05 |
| Malaysia | 3496090.0 | 6.741625e+07 | 32942.0 | 3.277620e+07 | 2.056866 | 1.005059e-03 |
| Norway | 1279169.0 | 1.123317e+07 | 1666.0 | 5.465629e+06 | 2.055238 | 3.048140e-04 |
| Cambodia | 131004.0 | 3.467897e+07 | 3032.0 | 1.694645e+07 | 2.046386 | 1.789166e-04 |
| Germany | 15175471.0 | 1.701530e+08 | 123431.0 | 8.390047e+07 | 2.028034 | 1.471160e-03 |
| United Arab Emirates | 880970.0 | 2.018434e+07 | 2301.0 | 9.991083e+06 | 2.020235 | 2.303054e-04 |
| United Kingdom | 18241147.0 | 1.372498e+08 | 160727.0 | 6.820711e+07 | 2.012251 | 2.356455e-03 |
| Israel | 3652454.0 | 1.801561e+07 | 10245.0 | 9.291000e+06 | 1.939039 | 1.102680e-03 |
| Portugal | 3282618.0 | 1.964667e+07 | 21111.0 | 1.016792e+07 | 1.932221 | 2.076235e-03 |
| Upper middle income | 118212049.0 | 4.804681e+09 | 2421471.0 | 2.513673e+09 | 1.911419 | 9.633199e-04 |
| High income | 236393139.0 | 2.306054e+09 | 2211971.0 | 1.214930e+09 | 1.898096 | 1.820657e-03 |
| Luxembourg | 186210.0 | 1.178840e+06 | 995.0 | 6.348140e+05 | 1.856985 | 1.567388e-03 |
| Greece | 2454429.0 | 1.907120e+07 | 25972.0 | 1.037075e+07 | 1.838941 | 2.504352e-03 |
| Liechtenstein | 12165.0 | 7.022800e+04 | 78.0 | 3.825400e+04 | 1.835834 | 2.039002e-03 |
| Peru | 3518721.0 | 6.113136e+07 | 211453.0 | 3.335942e+07 | 1.832507 | 6.338630e-03 |
| European Union | 110033392.0 | 8.184271e+08 | 1015772.0 | 4.471899e+08 | 1.830156 | 2.271456e-03 |
| Brazil | 28741413.0 | 3.902730e+08 | 650254.0 | 2.139934e+08 | 1.823761 | 3.038663e-03 |
| Argentina | 8912317.0 | 8.251164e+07 | 126390.0 | 4.560582e+07 | 1.809235 | 2.771357e-03 |
| Switzerland | 2842412.0 | 1.556814e+07 | 13269.0 | 8.715494e+06 | 1.786260 | 1.522461e-03 |
| Ecuador | 844764.0 | 3.131789e+07 | 22611.0 | 1.788847e+07 | 1.750730 | 1.263998e-03 |
| Qatar | 357583.0 | 5.106175e+06 | 670.0 | 2.930524e+06 | 1.742410 | 2.286281e-04 |
| North America | 93195128.0 | 1.030269e+09 | 1374621.0 | 5.965813e+08 | 1.726955 | 2.304164e-03 |
| Oceania | 3735739.0 | 7.462766e+07 | 7922.0 | 4.321995e+07 | 1.726695 | 1.832950e-04 |
| Hong Kong | 293754.0 | 1.302273e+07 | 1168.0 | 7.552800e+06 | 1.724226 | 1.546446e-04 |
| South America | 54222621.0 | 7.462801e+08 | 1247285.0 | 4.342601e+08 | 1.718509 | 2.872207e-03 |
| Turkey | 13382896.0 | 1.434464e+08 | 94837.0 | 8.504274e+07 | 1.686757 | 1.115169e-03 |
| Bahrain | 519584.0 | 2.927653e+06 | 1511.0 | 1.748295e+06 | 1.674576 | 8.642706e-04 |
| Europe | 158815550.0 | 1.247823e+09 | 1717056.0 | 7.489630e+08 | 1.666068 | 2.292578e-03 |
| United States | 79143715.0 | 5.537498e+08 | 954518.0 | 3.329151e+08 | 1.663336 | 2.867152e-03 |
| Lithuania | 913223.0 | 4.449324e+06 | 8442.0 | 2.689862e+06 | 1.654109 | 3.138451e-03 |
| Saudi Arabia | 746066.0 | 5.737721e+07 | 9002.0 | 3.534068e+07 | 1.623546 | 2.547206e-04 |
| Czechia | 3602844.0 | 1.739288e+07 | 38771.0 | 1.072455e+07 | 1.621781 | 3.615162e-03 |
| Asia | 117811418.0 | 7.544342e+09 | 1351250.0 | 4.678445e+09 | 1.612575 | 2.888246e-04 |
| Thailand | 2958176.0 | 1.087844e+08 | 23072.0 | 6.995084e+07 | 1.555156 | 3.298316e-04 |
| Taiwan | 20584.0 | 3.695129e+07 | 853.0 | 2.385501e+07 | 1.548995 | 3.575769e-05 |
| Latvia | 673218.0 | 2.855540e+06 | 5284.0 | 1.866934e+06 | 1.529535 | 2.830309e-03 |
| Sri Lanka | 647699.0 | 3.284874e+07 | 16267.0 | 2.149731e+07 | 1.528040 | 7.566995e-04 |
| Estonia | 504148.0 | 1.955946e+06 | 2268.0 | 1.325188e+06 | 1.475976 | 1.711455e-03 |
| World | 439011701.0 | 1.122516e+10 | 5946817.0 | 7.874966e+09 | 1.425424 | 7.551547e-04 |
| Slovenia | 897040.0 | 2.956720e+06 | 6327.0 | 2.078723e+06 | 1.422373 | 3.043696e-03 |
| Maldives | 171114.0 | 7.707100e+05 | 297.0 | 5.436200e+05 | 1.417737 | 5.463375e-04 |
| Panama | 756085.0 | 5.934725e+06 | 8098.0 | 4.381583e+06 | 1.354471 | 1.848190e-03 |
| Spain | 11139724.0 | 6.310748e+07 | 100778.0 | 4.674521e+07 | 1.350031 | 2.155900e-03 |
| Mongolia | 909379.0 | 4.407760e+06 | 2171.0 | 3.329282e+06 | 1.323937 | 6.520926e-04 |
| Japan | 5143816.0 | 1.667069e+08 | 24140.0 | 1.260508e+08 | 1.322538 | 1.915101e-04 |
| Vietnam | 3709481.0 | 1.209025e+08 | 40637.0 | 9.816883e+07 | 1.231578 | 4.139501e-04 |
| India | 42945160.0 | 1.708969e+09 | 507015.0 | 1.393409e+09 | 1.226466 | 3.638666e-04 |
| Dominican Republic | 575157.0 | 1.331425e+07 | 4370.0 | 1.095371e+07 | 1.215501 | 3.989514e-04 |
| Lower middle income | 82588725.0 | 3.974325e+09 | 1271503.0 | 3.330653e+09 | 1.193257 | 3.817579e-04 |
| Curacao | 39016.0 | 1.840890e+05 | 261.0 | 1.647960e+05 | 1.117072 | 1.583776e-03 |
| Mexico | 5521744.0 | 1.451079e+08 | 311470.0 | 1.302622e+08 | 1.113968 | 2.391100e-03 |
| Bhutan | 13535.0 | 8.620330e+05 | 6.0 | 7.799000e+05 | 1.105312 | 7.693294e-06 |
| Isle of Man | 23099.0 | 9.206400e+04 | 80.0 | 8.541000e+04 | 1.077907 | 9.366585e-04 |
| Trinidad and Tobago | 128691.0 | 1.503347e+06 | 3637.0 | 1.403374e+06 | 1.071238 | 2.591611e-03 |
| Bolivia | 893775.0 | 1.258651e+07 | 21443.0 | 1.183294e+07 | 1.063684 | 1.812145e-03 |
| Aruba | 33684.0 | 1.091530e+05 | 212.0 | 1.071950e+05 | 1.018266 | 1.977704e-03 |
| Macao | 81.0 | 6.627460e+05 | 0.0 | 6.583910e+05 | 1.006615 | 0.000000e+00 |
| Azerbaijan | 787367.0 | 1.023182e+07 | 9454.0 | 1.022334e+07 | 1.000829 | 9.247463e-04 |
| Barbados | 55543.0 | 2.868630e+05 | 316.0 | 2.877080e+05 | 0.997063 | 1.098336e-03 |
| Poland | 5694767.0 | 3.742697e+07 | 111864.0 | 3.779700e+07 | 0.990210 | 2.959600e-03 |
| Indonesia | 5630096.0 | 2.724306e+08 | 149036.0 | 2.763618e+08 | 0.985775 | 5.392786e-04 |
| Kazakhstan | 1450652.0 | 1.870224e+07 | 19239.0 | 1.899496e+07 | 0.984590 | 1.012848e-03 |
| Russia | 16353868.0 | 1.434654e+08 | 346197.0 | 1.459120e+08 | 0.983232 | 2.372642e-03 |
| Colombia | 6067023.0 | 4.938413e+07 | 138899.0 | 5.126584e+07 | 0.963295 | 2.709387e-03 |
| Montenegro | 230512.0 | 5.963530e+05 | 2683.0 | 6.280510e+05 | 0.949530 | 4.271946e-03 |
| Croatia | 1058453.0 | 3.677004e+06 | 15122.0 | 4.081657e+06 | 0.900861 | 3.704868e-03 |
| Romania | 2748777.0 | 1.665058e+07 | 63668.0 | 1.912777e+07 | 0.870492 | 3.328563e-03 |
| Hungary | 1793120.0 | 8.276404e+06 | 44134.0 | 9.634162e+06 | 0.859068 | 4.580990e-03 |
| Greenland | 11760.0 | 4.333600e+04 | 19.0 | 5.686800e+04 | 0.762045 | 3.341071e-04 |
| El Salvador | 156456.0 | 4.886767e+06 | 4077.0 | 6.518500e+06 | 0.749677 | 6.254506e-04 |
| Kosovo | 226392.0 | 1.330147e+06 | 3116.0 | 1.782115e+06 | 0.746387 | 1.748484e-03 |
| Guatemala | 784024.0 | 1.341083e+07 | 17021.0 | 1.824987e+07 | 0.734845 | 9.326643e-04 |
| Morocco | 1161290.0 | 2.740605e+07 | 16002.0 | 3.734479e+07 | 0.733866 | 4.284935e-04 |
| Ukraine | 5040518.0 | 3.168315e+07 | 112459.0 | 4.346682e+07 | 0.728904 | 2.587238e-03 |
| Tunisia | 999441.0 | 8.530717e+06 | 27824.0 | 1.193576e+07 | 0.714719 | 2.331145e-03 |
| Faeroe Islands | 34658.0 | 3.481300e+04 | 28.0 | 4.905300e+04 | 0.709702 | 5.708112e-04 |
| Lebanon | 1072537.0 | 4.755512e+06 | 10115.0 | 6.769151e+06 | 0.702527 | 1.494279e-03 |
| Iceland | 135748.0 | 2.588510e+05 | 66.0 | 3.687920e+05 | 0.701889 | 1.789627e-04 |
| Bulgaria | 1096194.0 | 4.143716e+06 | 35696.0 | 6.896655e+06 | 0.600830 | 5.175842e-03 |
| Brunei | 71667.0 | 2.627530e+05 | 129.0 | 4.415320e+05 | 0.595094 | 2.921646e-04 |
| San Marino | 14435.0 | 2.014100e+04 | 112.0 | 3.401000e+04 | 0.592208 | 3.293149e-03 |
| Suriname | 78353.0 | 3.429360e+05 | 1317.0 | 5.917980e+05 | 0.579482 | 2.225422e-03 |
| Paraguay | 642573.0 | 4.105501e+06 | 18422.0 | 7.219641e+06 | 0.568657 | 2.551650e-03 |
| Bangladesh | 1945108.0 | 8.807564e+07 | 29053.0 | 1.663035e+08 | 0.529608 | 1.746987e-04 |
| Philippines | 3663931.0 | 5.494906e+07 | 56506.0 | 1.110469e+08 | 0.494827 | 5.088480e-04 |
| Albania | 271825.0 | 1.415150e+06 | 3474.0 | 2.872934e+06 | 0.492580 | 1.209217e-03 |
| Cyprus | 326611.0 | 4.282040e+05 | 859.0 | 8.960050e+05 | 0.477904 | 9.587000e-04 |
| Serbia | 1916707.0 | 3.257010e+06 | 15318.0 | 6.871547e+06 | 0.473985 | 2.229192e-03 |
| Zimbabwe | 237509.0 | 7.080893e+06 | 5396.0 | 1.509217e+07 | 0.469177 | 3.575364e-04 |
| North Macedonia | 298195.0 | 9.505510e+05 | 9036.0 | 2.082661e+06 | 0.456412 | 4.338680e-03 |
| Uzbekistan | 236596.0 | 1.512707e+07 | 1637.0 | 3.393576e+07 | 0.445756 | 4.823819e-05 |
| Seychelles | 39408.0 | 4.286300e+04 | 163.0 | 9.891000e+04 | 0.433354 | 1.647963e-03 |
| Africa | 11230524.0 | 5.818190e+08 | 248668.0 | 1.373486e+09 | 0.423607 | 1.810487e-04 |
| Jordan | 1638338.0 | 4.260392e+06 | 13849.0 | 1.026902e+07 | 0.414878 | 1.348619e-03 |
| Pakistan | 1511754.0 | 8.561347e+07 | 30237.0 | 2.251999e+08 | 0.380167 | 1.342674e-04 |
| Georgia | 1616159.0 | 1.413257e+06 | 16231.0 | 3.979773e+06 | 0.355110 | 4.078373e-03 |
| Moldova | 502956.0 | 1.305637e+06 | 10657.0 | 4.024025e+06 | 0.324460 | 2.648343e-03 |
| Nepal | 977200.0 | 9.492136e+06 | 11941.0 | 2.967492e+07 | 0.319871 | 4.023937e-04 |
| Palestine | 648039.0 | 1.655605e+06 | 5532.0 | 5.222756e+06 | 0.316998 | 1.059211e-03 |
| Kyrgyzstan | 200556.0 | 2.076513e+06 | 3403.0 | 6.628347e+06 | 0.313278 | 5.134010e-04 |
| Belize | 56816.0 | 1.226920e+05 | 654.0 | 4.049150e+05 | 0.303007 | 1.615154e-03 |
| Guernsey | 0.0 | 1.593100e+04 | 0.0 | 6.338500e+04 | 0.251337 | 0.000000e+00 |
| Laos | 143240.0 | 1.802450e+06 | 623.0 | 7.379358e+06 | 0.244256 | 8.442469e-05 |
| South Africa | 3659100.0 | 1.442119e+07 | 99135.0 | 6.004200e+07 | 0.240185 | 1.651094e-03 |
| Cayman Islands | 19373.0 | 1.533900e+04 | 17.0 | 6.649800e+04 | 0.230669 | 2.556468e-04 |
| Finland | 658559.0 | 1.235072e+06 | 2381.0 | 5.548361e+06 | 0.222601 | 4.291357e-04 |
| Low income | 1805056.0 | 1.391686e+08 | 41804.0 | 6.651490e+08 | 0.209229 | 6.284907e-05 |
| Kenya | 323002.0 | 1.141772e+07 | 5640.0 | 5.498570e+07 | 0.207649 | 1.025721e-04 |
| Iran | 7066975.0 | 1.673545e+07 | 137267.0 | 8.502876e+07 | 0.196821 | 1.614360e-03 |
| Ethiopia | 468786.0 | 2.131937e+07 | 7467.0 | 1.178762e+08 | 0.180862 | 6.334611e-05 |
| Jamaica | 128079.0 | 4.916840e+05 | 2814.0 | 2.973462e+06 | 0.165357 | 9.463716e-04 |
| Saint Lucia | 22729.0 | 2.625500e+04 | 360.0 | 1.844010e+05 | 0.142380 | 1.952267e-03 |
| Saint Vincent and the Grenadines | 10045.0 | 1.569000e+04 | 106.0 | 1.112690e+05 | 0.141010 | 9.526463e-04 |
| Saint Kitts and Nevis | 5530.0 | 6.553000e+03 | 42.0 | 5.354600e+04 | 0.122381 | 7.843723e-04 |
| Guinea | 36397.0 | 1.586407e+06 | 440.0 | 1.349724e+07 | 0.117536 | 3.259926e-05 |
| Guyana | 62986.0 | 8.656300e+04 | 1222.0 | 7.903290e+05 | 0.109528 | 1.546192e-03 |
| Eswatini | 69211.0 | 1.107650e+05 | 1390.0 | 1.172369e+06 | 0.094480 | 1.185634e-03 |
| Anguilla | 2555.0 | 1.421000e+03 | 10.0 | 1.512500e+04 | 0.093950 | 6.611570e-04 |
| Namibia | 157275.0 | 2.347090e+05 | 4010.0 | 2.587344e+06 | 0.090714 | 1.549852e-03 |
| Dominica | 11142.0 | 6.417000e+03 | 57.0 | 7.217200e+04 | 0.088913 | 7.897800e-04 |
| Cote d'Ivoire | 81552.0 | 2.285727e+06 | 794.0 | 2.705363e+07 | 0.084489 | 2.934911e-05 |
| Antigua and Barbuda | 7451.0 | 8.107000e+03 | 135.0 | 9.872800e+04 | 0.082114 | 1.367393e-03 |
| Zambia | 313203.0 | 1.321156e+06 | 3955.0 | 1.892066e+07 | 0.069826 | 2.090308e-04 |
| Rwanda | 129533.0 | 9.206440e+05 | 1457.0 | 1.327652e+07 | 0.069344 | 1.097426e-04 |
| Malawi | 85362.0 | 1.267776e+06 | 2617.0 | 1.964768e+07 | 0.064525 | 1.331964e-04 |
| Andorra | 38249.0 | 4.802000e+03 | 151.0 | 7.735400e+04 | 0.062078 | 1.952065e-03 |
| Fiji | 63999.0 | 2.829500e+04 | 836.0 | 9.028990e+05 | 0.031338 | 9.259064e-04 |
| Bosnia and Herzegovina | 371553.0 | 9.386200e+04 | 15506.0 | 3.263459e+06 | 0.028762 | 4.751400e-03 |
| Mauritius | 71004.0 | 3.515300e+04 | 786.0 | 1.273428e+06 | 0.027605 | 6.172316e-04 |
| Bahamas | 33198.0 | 9.258000e+03 | 771.0 | 3.969140e+05 | 0.023325 | 1.942486e-03 |
| Honduras | 412753.0 | 2.290260e+05 | 10779.0 | 1.006299e+07 | 0.022759 | 1.071152e-03 |
| Libya | 495972.0 | 1.416880e+05 | 6279.0 | 6.958538e+06 | 0.020362 | 9.023447e-04 |
| Senegal | 85712.0 | 3.485540e+05 | 1960.0 | 1.719631e+07 | 0.020269 | 1.139780e-04 |
| Egypt | 486381.0 | 2.078777e+06 | 24132.0 | 1.042583e+08 | 0.019939 | 2.314635e-04 |
| Nauru | 0.0 | 1.680000e+02 | 0.0 | 1.087300e+04 | 0.015451 | 0.000000e+00 |
| Uganda | 163447.0 | 7.200770e+05 | 3594.0 | 4.712353e+07 | 0.015281 | 7.626763e-05 |
| Nigeria | 254598.0 | 3.160328e+06 | 3143.0 | 2.114007e+08 | 0.014949 | 1.486750e-05 |
| Cape Verde | 55889.0 | 7.462000e+03 | 402.0 | 5.619010e+05 | 0.013280 | 7.154285e-04 |
| Tajikistan | 17786.0 | 1.247450e+05 | 125.0 | 9.749625e+06 | 0.012795 | 1.282101e-05 |
| Oman | 383389.0 | 6.508100e+04 | 4246.0 | 5.223376e+06 | 0.012460 | 8.128842e-04 |
| Mozambique | 225096.0 | 2.958120e+05 | 2227.0 | 3.216304e+07 | 0.009197 | 6.924096e-05 |
| Grenada | 13707.0 | 1.037000e+03 | 216.0 | 1.130150e+05 | 0.009176 | 1.911251e-03 |
| Kuwait | 620980.0 | 3.092700e+04 | 2540.0 | 4.328553e+06 | 0.007145 | 5.868012e-04 |
| Timor | 22732.0 | 7.881000e+03 | 129.0 | 1.343875e+06 | 0.005864 | 9.599107e-05 |
| Ghana | 159891.0 | 1.809500e+05 | 1442.0 | 3.173213e+07 | 0.005702 | 4.544290e-05 |
| Mauritania | 58638.0 | 2.465900e+04 | 979.0 | 4.775110e+06 | 0.005164 | 2.050215e-04 |
| Sweden | 2451464.0 | 4.761600e+04 | 17611.0 | 1.016016e+07 | 0.004687 | 1.733339e-03 |
| Botswana | 263950.0 | 1.043500e+04 | 2619.0 | 2.397240e+06 | 0.004353 | 1.092506e-03 |
| Algeria | 265079.0 | 1.707860e+05 | 6843.0 | 4.461663e+07 | 0.003828 | 1.533733e-04 |
| Haiti | 30350.0 | 4.145300e+04 | 897.0 | 1.154168e+07 | 0.003592 | 7.771830e-05 |
| French Polynesia | 67660.0 | 8.550000e+02 | 641.0 | 2.825340e+05 | 0.003026 | 2.268753e-03 |
| Central African Republic | 14225.0 | 1.288700e+04 | 113.0 | 4.919987e+06 | 0.002619 | 2.296754e-05 |
| Somalia | 26351.0 | 3.729200e+04 | 1349.0 | 1.635950e+07 | 0.002280 | 8.245973e-05 |
| Liberia | 7510.0 | 1.008900e+04 | 294.0 | 5.180208e+06 | 0.001948 | 5.675448e-05 |
| Sudan | 61525.0 | 4.557200e+04 | 3910.0 | 4.490935e+07 | 0.001015 | 8.706427e-05 |
| Sierra Leone | 7665.0 | 7.981000e+03 | 125.0 | 8.141343e+06 | 0.000980 | 1.535373e-05 |
| Guinea-Bissau | 8027.0 | 1.658000e+03 | 167.0 | 2.015490e+06 | 0.000823 | 8.285826e-05 |
| South Sudan | 16989.0 | 7.489000e+03 | 137.0 | 1.138138e+07 | 0.000658 | 1.203721e-05 |
| Gabon | 47543.0 | 1.486000e+03 | 303.0 | 2.278829e+06 | 0.000652 | 1.329630e-04 |
| Madagascar | 63666.0 | 1.354400e+04 | 1366.0 | 2.842733e+07 | 0.000476 | 4.805234e-05 |
| Democratic Republic of Congo | 86039.0 | 4.230300e+04 | 1335.0 | 9.237799e+07 | 0.000458 | 1.445149e-05 |
| Equatorial Guinea | 15885.0 | 6.390000e+02 | 183.0 | 1.449891e+06 | 0.000441 | 1.262164e-04 |
| Cameroon | 119240.0 | 1.029000e+04 | 1923.0 | 2.722426e+07 | 0.000378 | 7.063552e-05 |
| Afghanistan | 174081.0 | 1.374200e+04 | 7617.0 | 3.983543e+07 | 0.000345 | 1.912117e-04 |
| Congo | 24020.0 | 1.486000e+03 | 409.0 | 5.657017e+06 | 0.000263 | 7.229959e-05 |
| Iraq | 2305083.0 | 9.985000e+03 | 25013.0 | 4.117935e+07 | 0.000242 | 6.074161e-04 |
| Gambia | 12039.0 | 4.290000e+02 | 365.0 | 2.486937e+06 | 0.000173 | 1.467669e-04 |
| Myanmar | 592139.0 | 3.800000e+03 | 19376.0 | 5.480601e+07 | 0.000069 | 3.535378e-04 |
| Burundi | 38127.0 | 4.600000e+02 | 38.0 | 1.225543e+07 | 0.000038 | 3.100667e-06 |
| Northern Cyprus | 0.0 | 1.988000e+03 | 0.0 | 1.474690e+08 | 0.000013 | 0.000000e+00 |
| Chad | 7257.0 | 0.000000e+00 | 190.0 | 1.691498e+07 | 0.000000 | 1.123264e-05 |
| Angola | 98746.0 | 0.000000e+00 | 1903.0 | 3.393361e+07 | 0.000000 | 5.608009e-05 |
| Tonga | 355.0 | 0.000000e+00 | 0.0 | 1.067590e+05 | 0.000000 | 0.000000e+00 |
| Yemen | 11772.0 | 0.000000e+00 | 2135.0 | 3.049064e+07 | 0.000000 | 7.002149e-05 |
| Armenia | 420498.0 | 0.000000e+00 | 8495.0 | 2.968128e+06 | 0.000000 | 2.862073e-03 |
| Tokelau | 0.0 | 0.000000e+00 | 0.0 | 1.368000e+03 | 0.000000 | 0.000000e+00 |
| Togo | 36808.0 | 0.000000e+00 | 272.0 | 8.478242e+06 | 0.000000 | 3.208212e-05 |
| Cook Islands | 2.0 | 0.000000e+00 | 0.0 | 1.757200e+04 | 0.000000 | 0.000000e+00 |
| Comoros | 8033.0 | 0.000000e+00 | 161.0 | 8.884560e+05 | 0.000000 | 1.812133e-04 |
| Austria | 2744023.0 | 0.000000e+00 | 14902.0 | 9.043072e+06 | 0.000000 | 1.647891e-03 |
| Turkmenistan | 0.0 | 0.000000e+00 | 0.0 | 6.117933e+06 | 0.000000 | 0.000000e+00 |
| Venezuela | 515582.0 | 0.000000e+00 | 5645.0 | 2.870495e+07 | 0.000000 | 1.966560e-04 |
| Tuvalu | 0.0 | 0.000000e+00 | 0.0 | 1.192500e+04 | 0.000000 | 0.000000e+00 |
| Costa Rica | 811040.0 | 0.000000e+00 | 8057.0 | 5.139053e+06 | 0.000000 | 1.567799e-03 |
| Wallis and Futuna | 454.0 | 0.000000e+00 | 7.0 | 1.109400e+04 | 0.000000 | 6.309717e-04 |
| Burkina Faso | 20751.0 | 0.000000e+00 | 375.0 | 2.149710e+07 | 0.000000 | 1.744422e-05 |
| British Virgin Islands | 6085.0 | 0.000000e+00 | 62.0 | 3.042300e+04 | 0.000000 | 2.037932e-03 |
| Bonaire Sint Eustatius and Saba | 7599.0 | 0.000000e+00 | 33.0 | 2.644500e+04 | 0.000000 | 1.247873e-03 |
| Bermuda | 11561.0 | 0.000000e+00 | 123.0 | 6.209200e+04 | 0.000000 | 1.980932e-03 |
| Benin | 26776.0 | 0.000000e+00 | 163.0 | 1.245103e+07 | 0.000000 | 1.309129e-05 |
| Belarus | 923432.0 | 0.000000e+00 | 6506.0 | 9.442867e+06 | 0.000000 | 6.889857e-04 |
| Vanuatu | 19.0 | 0.000000e+00 | 1.0 | 3.144640e+05 | 0.000000 | 3.180014e-06 |
| Vatican | 29.0 | 0.000000e+00 | 0.0 | 8.120000e+02 | 0.000000 | 0.000000e+00 |
| Turks and Caicos Islands | 5868.0 | 0.000000e+00 | 36.0 | 3.922600e+04 | 0.000000 | 9.177586e-04 |
| Papua New Guinea | 41351.0 | 0.000000e+00 | 638.0 | 9.119005e+06 | 0.000000 | 6.996377e-05 |
| Tanzania | 33620.0 | 0.000000e+00 | 798.0 | 6.149844e+07 | 0.000000 | 1.297594e-05 |
| Djibouti | 15547.0 | 0.000000e+00 | 189.0 | 1.002197e+06 | 0.000000 | 1.885857e-04 |
| Palau | 3823.0 | 0.000000e+00 | 6.0 | 1.817400e+04 | 0.000000 | 3.301420e-04 |
| Niue | 0.0 | 0.000000e+00 | 0.0 | 1.614000e+03 | 0.000000 | 0.000000e+00 |
| Niger | 8763.0 | 0.000000e+00 | 307.0 | 2.513081e+07 | 0.000000 | 1.221608e-05 |
| Nicaragua | 18105.0 | 0.000000e+00 | 225.0 | 6.702379e+06 | 0.000000 | 3.357017e-05 |
| New Caledonia | 55503.0 | 0.000000e+00 | 301.0 | 2.882170e+05 | 0.000000 | 1.044352e-03 |
| Saint Helena | 4.0 | 0.000000e+00 | 0.0 | 6.095000e+03 | 0.000000 | 0.000000e+00 |
| Netherlands | 6540294.0 | 0.000000e+00 | 21710.0 | 1.717309e+07 | 0.000000 | 1.264187e-03 |
| Saint Pierre and Miquelon | 1089.0 | 0.000000e+00 | 1.0 | 5.771000e+03 | 0.000000 | 1.732802e-04 |
| Montserrat | 164.0 | 0.000000e+00 | 2.0 | 4.981000e+03 | 0.000000 | 4.015258e-04 |
| Samoa | 33.0 | 0.000000e+00 | 0.0 | 2.001440e+05 | 0.000000 | 0.000000e+00 |
| Monaco | 9457.0 | 0.000000e+00 | 54.0 | 3.952000e+04 | 0.000000 | 1.366397e-03 |
| Sao Tome and Principe | 5934.0 | 0.000000e+00 | 76.0 | 2.233640e+05 | 0.000000 | 3.402518e-04 |
| Micronesia (country) | 1.0 | 0.000000e+00 | 0.0 | 1.162550e+05 | 0.000000 | 0.000000e+00 |
| Marshall Islands | 8.0 | 0.000000e+00 | 0.0 | 5.961800e+04 | 0.000000 | 0.000000e+00 |
| Mali | 30391.0 | 0.000000e+00 | 722.0 | 2.085572e+07 | 0.000000 | 3.461879e-05 |
| Lesotho | 32612.0 | 0.000000e+00 | 696.0 | 2.159067e+06 | 0.000000 | 3.223615e-04 |
| Sint Maarten (Dutch part) | 0.0 | 0.000000e+00 | 0.0 | 4.342100e+04 | 0.000000 | 0.000000e+00 |
| Slovakia | 2150666.0 | 0.000000e+00 | 18567.0 | 5.449270e+06 | 0.000000 | 3.407245e-03 |
| Kiribati | 2953.0 | 0.000000e+00 | 11.0 | 1.213880e+05 | 0.000000 | 9.061851e-05 |
| Solomon Islands | 7261.0 | 0.000000e+00 | 106.0 | 7.039950e+05 | 0.000000 | 1.505693e-04 |
| Jersey | 0.0 | 0.000000e+00 | 0.0 | 1.010730e+05 | 0.000000 | 0.000000e+00 |
| International | 721.0 | 0.000000e+00 | 15.0 | 1.474690e+08 | 0.000000 | 1.017163e-07 |
| Pitcairn | 0.0 | 0.000000e+00 | 0.0 | 4.700000e+01 | 0.000000 | 0.000000e+00 |
| Eritrea | 9705.0 | 0.000000e+00 | 103.0 | 3.601462e+06 | 0.000000 | 2.859950e-05 |
| Syria | 54744.0 | 0.000000e+00 | 3082.0 | 1.827570e+07 | 0.000000 | 1.686392e-04 |
| Falkland Islands | 115.0 | 0.000000e+00 | 0.0 | 3.528000e+03 | 0.000000 | 0.000000e+00 |
Now we select the desired countries
selected_countries = ['France', 'Brazil','Estonia','Azerbaijan','Paraguay']
df_p2_q2 = df_p2_q2.loc[selected_countries]
df_p2_q2
| new_cases | new_vaccinations | new_deaths | population | ratio1 | ratio2 | |
|---|---|---|---|---|---|---|
| location | ||||||
| France | 23316777.0 | 140849628.0 | 138537.0 | 67422000.0 | 2.089075 | 0.002055 |
| Brazil | 28741413.0 | 390272980.0 | 650254.0 | 213993441.0 | 1.823761 | 0.003039 |
| Estonia | 504148.0 | 1955946.0 | 2268.0 | 1325188.0 | 1.475976 | 0.001711 |
| Azerbaijan | 787367.0 | 10231821.0 | 9454.0 | 10223344.0 | 1.000829 | 0.000925 |
| Paraguay | 642573.0 | 4105501.0 | 18422.0 | 7219641.0 | 0.568657 | 0.002552 |
plt.figure(figsize=(12,8))
ax = sns.scatterplot(df_p2_q2['ratio1'], df_p2_q2['ratio2'], alpha=0.8)
ax.set_title("The effect of vaccination on the number of deaths",fontsize=15)
ax.set_xlabel('new_vaccinations / population',fontsize=15)
ax.set_ylabel('new_deaths / population',fontsize=15)
plt.show()
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation. warnings.warn(
According to the above chart, it can be said that increasing the number of vaccinations does not necessarily reduce the number of deaths and parameters other than the number of vaccinations affect the number of deaths.
In this part, We intend to examine the speed of vaccination in different countries. To do this, we sort the values in new_vaccinations column, and after sorting, we select one country out of every fifth one for review and comparison.
df_p2_q3 = df_p1_q2.sort_values(by= ['new_vaccinations'], ascending= [False])
df_p2_q3
| new_cases | new_vaccinations | new_deaths | population | |
|---|---|---|---|---|
| location | ||||
| World | 439011701.0 | 1.122516e+10 | 5946817.0 | 7.874966e+09 |
| Asia | 117811418.0 | 7.544342e+09 | 1351250.0 | 4.678445e+09 |
| Upper middle income | 118212049.0 | 4.804681e+09 | 2421471.0 | 2.513673e+09 |
| Lower middle income | 82588725.0 | 3.974325e+09 | 1271503.0 | 3.330653e+09 |
| China | 109423.0 | 3.061013e+09 | 4640.0 | 1.444216e+09 |
| High income | 236393139.0 | 2.306054e+09 | 2211971.0 | 1.214930e+09 |
| India | 42945160.0 | 1.708969e+09 | 507015.0 | 1.393409e+09 |
| Europe | 158815550.0 | 1.247823e+09 | 1717056.0 | 7.489630e+08 |
| North America | 93195128.0 | 1.030269e+09 | 1374621.0 | 5.965813e+08 |
| European Union | 110033392.0 | 8.184271e+08 | 1015772.0 | 4.471899e+08 |
| South America | 54222621.0 | 7.462801e+08 | 1247285.0 | 4.342601e+08 |
| Africa | 11230524.0 | 5.818190e+08 | 248668.0 | 1.373486e+09 |
| United States | 79143715.0 | 5.537498e+08 | 954518.0 | 3.329151e+08 |
| Brazil | 28741413.0 | 3.902730e+08 | 650254.0 | 2.139934e+08 |
| Indonesia | 5630096.0 | 2.724306e+08 | 149036.0 | 2.763618e+08 |
| Germany | 15175471.0 | 1.701530e+08 | 123431.0 | 8.390047e+07 |
| Japan | 5143816.0 | 1.667069e+08 | 24140.0 | 1.260508e+08 |
| Mexico | 5521744.0 | 1.451079e+08 | 311470.0 | 1.302622e+08 |
| Russia | 16353868.0 | 1.434654e+08 | 346197.0 | 1.459120e+08 |
| Turkey | 13382896.0 | 1.434464e+08 | 94837.0 | 8.504274e+07 |
| France | 23316777.0 | 1.408496e+08 | 138537.0 | 6.742200e+07 |
| Low income | 1805056.0 | 1.391686e+08 | 41804.0 | 6.651490e+08 |
| United Kingdom | 18241147.0 | 1.372498e+08 | 160727.0 | 6.820711e+07 |
| Italy | 12868066.0 | 1.343115e+08 | 155245.0 | 6.036747e+07 |
| Vietnam | 3709481.0 | 1.209025e+08 | 40637.0 | 9.816883e+07 |
| South Korea | 3691487.0 | 1.192514e+08 | 8394.0 | 5.130518e+07 |
| Thailand | 2958176.0 | 1.087844e+08 | 23072.0 | 6.995084e+07 |
| Bangladesh | 1945108.0 | 8.807564e+07 | 29053.0 | 1.663035e+08 |
| Pakistan | 1511754.0 | 8.561347e+07 | 30237.0 | 2.251999e+08 |
| Argentina | 8912317.0 | 8.251164e+07 | 126390.0 | 4.560582e+07 |
| Canada | 3303284.0 | 8.106477e+07 | 36728.0 | 3.806791e+07 |
| Oceania | 3735739.0 | 7.462766e+07 | 7922.0 | 4.321995e+07 |
| Malaysia | 3496090.0 | 6.741625e+07 | 32942.0 | 3.277620e+07 |
| Spain | 11139724.0 | 6.310748e+07 | 100778.0 | 4.674521e+07 |
| Peru | 3518721.0 | 6.113136e+07 | 211453.0 | 3.335942e+07 |
| Saudi Arabia | 746066.0 | 5.737721e+07 | 9002.0 | 3.534068e+07 |
| Philippines | 3663931.0 | 5.494906e+07 | 56506.0 | 1.110469e+08 |
| Australia | 3326214.0 | 5.379783e+07 | 5319.0 | 2.578822e+07 |
| Colombia | 6067023.0 | 4.938413e+07 | 138899.0 | 5.126584e+07 |
| Chile | 3098110.0 | 4.855777e+07 | 42624.0 | 1.921236e+07 |
| Poland | 5694767.0 | 3.742697e+07 | 111864.0 | 3.779700e+07 |
| Taiwan | 20584.0 | 3.695129e+07 | 853.0 | 2.385501e+07 |
| Cambodia | 131004.0 | 3.467897e+07 | 3032.0 | 1.694645e+07 |
| Sri Lanka | 647699.0 | 3.284874e+07 | 16267.0 | 2.149731e+07 |
| Ukraine | 5040518.0 | 3.168315e+07 | 112459.0 | 4.346682e+07 |
| Ecuador | 844764.0 | 3.131789e+07 | 22611.0 | 1.788847e+07 |
| Cuba | 1070730.0 | 3.065243e+07 | 8497.0 | 1.131750e+07 |
| Morocco | 1161290.0 | 2.740605e+07 | 16002.0 | 3.734479e+07 |
| Belgium | 3563841.0 | 2.504046e+07 | 30316.0 | 1.163233e+07 |
| Ethiopia | 468786.0 | 2.131937e+07 | 7467.0 | 1.178762e+08 |
| United Arab Emirates | 880970.0 | 2.018434e+07 | 2301.0 | 9.991083e+06 |
| Portugal | 3282618.0 | 1.964667e+07 | 21111.0 | 1.016792e+07 |
| Greece | 2454429.0 | 1.907120e+07 | 25972.0 | 1.037075e+07 |
| Kazakhstan | 1450652.0 | 1.870224e+07 | 19239.0 | 1.899496e+07 |
| Israel | 3652454.0 | 1.801561e+07 | 10245.0 | 9.291000e+06 |
| Czechia | 3602844.0 | 1.739288e+07 | 38771.0 | 1.072455e+07 |
| Iran | 7066975.0 | 1.673545e+07 | 137267.0 | 8.502876e+07 |
| Romania | 2748777.0 | 1.665058e+07 | 63668.0 | 1.912777e+07 |
| Switzerland | 2842412.0 | 1.556814e+07 | 13269.0 | 8.715494e+06 |
| Uzbekistan | 236596.0 | 1.512707e+07 | 1637.0 | 3.393576e+07 |
| South Africa | 3659100.0 | 1.442119e+07 | 99135.0 | 6.004200e+07 |
| Singapore | 767663.0 | 1.357254e+07 | 1040.0 | 5.453600e+06 |
| Guatemala | 784024.0 | 1.341083e+07 | 17021.0 | 1.824987e+07 |
| Dominican Republic | 575157.0 | 1.331425e+07 | 4370.0 | 1.095371e+07 |
| Denmark | 2805858.0 | 1.317204e+07 | 4633.0 | 5.813302e+06 |
| Hong Kong | 293754.0 | 1.302273e+07 | 1168.0 | 7.552800e+06 |
| Bolivia | 893775.0 | 1.258651e+07 | 21443.0 | 1.183294e+07 |
| Kenya | 323002.0 | 1.141772e+07 | 5640.0 | 5.498570e+07 |
| Norway | 1279169.0 | 1.123317e+07 | 1666.0 | 5.465629e+06 |
| New Zealand | 166103.0 | 1.067335e+07 | 56.0 | 5.126300e+06 |
| Ireland | 1315500.0 | 1.056764e+07 | 6540.0 | 4.982904e+06 |
| Azerbaijan | 787367.0 | 1.023182e+07 | 9454.0 | 1.022334e+07 |
| Nepal | 977200.0 | 9.492136e+06 | 11941.0 | 2.967492e+07 |
| Tunisia | 999441.0 | 8.530717e+06 | 27824.0 | 1.193576e+07 |
| Hungary | 1793120.0 | 8.276404e+06 | 44134.0 | 9.634162e+06 |
| Uruguay | 846889.0 | 7.622054e+06 | 7005.0 | 3.485152e+06 |
| Zimbabwe | 237509.0 | 7.080893e+06 | 5396.0 | 1.509217e+07 |
| Panama | 756085.0 | 5.934725e+06 | 8098.0 | 4.381583e+06 |
| Qatar | 357583.0 | 5.106175e+06 | 670.0 | 2.930524e+06 |
| El Salvador | 156456.0 | 4.886767e+06 | 4077.0 | 6.518500e+06 |
| Lebanon | 1072537.0 | 4.755512e+06 | 10115.0 | 6.769151e+06 |
| Lithuania | 913223.0 | 4.449324e+06 | 8442.0 | 2.689862e+06 |
| Mongolia | 909379.0 | 4.407760e+06 | 2171.0 | 3.329282e+06 |
| Jordan | 1638338.0 | 4.260392e+06 | 13849.0 | 1.026902e+07 |
| Bulgaria | 1096194.0 | 4.143716e+06 | 35696.0 | 6.896655e+06 |
| Paraguay | 642573.0 | 4.105501e+06 | 18422.0 | 7.219641e+06 |
| Croatia | 1058453.0 | 3.677004e+06 | 15122.0 | 4.081657e+06 |
| Serbia | 1916707.0 | 3.257010e+06 | 15318.0 | 6.871547e+06 |
| Nigeria | 254598.0 | 3.160328e+06 | 3143.0 | 2.114007e+08 |
| Slovenia | 897040.0 | 2.956720e+06 | 6327.0 | 2.078723e+06 |
| Bahrain | 519584.0 | 2.927653e+06 | 1511.0 | 1.748295e+06 |
| Latvia | 673218.0 | 2.855540e+06 | 5284.0 | 1.866934e+06 |
| Cote d'Ivoire | 81552.0 | 2.285727e+06 | 794.0 | 2.705363e+07 |
| Egypt | 486381.0 | 2.078777e+06 | 24132.0 | 1.042583e+08 |
| Kyrgyzstan | 200556.0 | 2.076513e+06 | 3403.0 | 6.628347e+06 |
| Estonia | 504148.0 | 1.955946e+06 | 2268.0 | 1.325188e+06 |
| Laos | 143240.0 | 1.802450e+06 | 623.0 | 7.379358e+06 |
| Palestine | 648039.0 | 1.655605e+06 | 5532.0 | 5.222756e+06 |
| Guinea | 36397.0 | 1.586407e+06 | 440.0 | 1.349724e+07 |
| Trinidad and Tobago | 128691.0 | 1.503347e+06 | 3637.0 | 1.403374e+06 |
| Albania | 271825.0 | 1.415150e+06 | 3474.0 | 2.872934e+06 |
| Georgia | 1616159.0 | 1.413257e+06 | 16231.0 | 3.979773e+06 |
| Kosovo | 226392.0 | 1.330147e+06 | 3116.0 | 1.782115e+06 |
| Zambia | 313203.0 | 1.321156e+06 | 3955.0 | 1.892066e+07 |
| Moldova | 502956.0 | 1.305637e+06 | 10657.0 | 4.024025e+06 |
| Malawi | 85362.0 | 1.267776e+06 | 2617.0 | 1.964768e+07 |
| Finland | 658559.0 | 1.235072e+06 | 2381.0 | 5.548361e+06 |
| Malta | 71497.0 | 1.205547e+06 | 608.0 | 5.161000e+05 |
| Luxembourg | 186210.0 | 1.178840e+06 | 995.0 | 6.348140e+05 |
| North Macedonia | 298195.0 | 9.505510e+05 | 9036.0 | 2.082661e+06 |
| Rwanda | 129533.0 | 9.206440e+05 | 1457.0 | 1.327652e+07 |
| Bhutan | 13535.0 | 8.620330e+05 | 6.0 | 7.799000e+05 |
| Maldives | 171114.0 | 7.707100e+05 | 297.0 | 5.436200e+05 |
| Uganda | 163447.0 | 7.200770e+05 | 3594.0 | 4.712353e+07 |
| Macao | 81.0 | 6.627460e+05 | 0.0 | 6.583910e+05 |
| Montenegro | 230512.0 | 5.963530e+05 | 2683.0 | 6.280510e+05 |
| Jamaica | 128079.0 | 4.916840e+05 | 2814.0 | 2.973462e+06 |
| Cyprus | 326611.0 | 4.282040e+05 | 859.0 | 8.960050e+05 |
| Senegal | 85712.0 | 3.485540e+05 | 1960.0 | 1.719631e+07 |
| Suriname | 78353.0 | 3.429360e+05 | 1317.0 | 5.917980e+05 |
| Mozambique | 225096.0 | 2.958120e+05 | 2227.0 | 3.216304e+07 |
| Barbados | 55543.0 | 2.868630e+05 | 316.0 | 2.877080e+05 |
| Brunei | 71667.0 | 2.627530e+05 | 129.0 | 4.415320e+05 |
| Iceland | 135748.0 | 2.588510e+05 | 66.0 | 3.687920e+05 |
| Namibia | 157275.0 | 2.347090e+05 | 4010.0 | 2.587344e+06 |
| Honduras | 412753.0 | 2.290260e+05 | 10779.0 | 1.006299e+07 |
| Curacao | 39016.0 | 1.840890e+05 | 261.0 | 1.647960e+05 |
| Ghana | 159891.0 | 1.809500e+05 | 1442.0 | 3.173213e+07 |
| Algeria | 265079.0 | 1.707860e+05 | 6843.0 | 4.461663e+07 |
| Libya | 495972.0 | 1.416880e+05 | 6279.0 | 6.958538e+06 |
| Tajikistan | 17786.0 | 1.247450e+05 | 125.0 | 9.749625e+06 |
| Belize | 56816.0 | 1.226920e+05 | 654.0 | 4.049150e+05 |
| Eswatini | 69211.0 | 1.107650e+05 | 1390.0 | 1.172369e+06 |
| Aruba | 33684.0 | 1.091530e+05 | 212.0 | 1.071950e+05 |
| Bosnia and Herzegovina | 371553.0 | 9.386200e+04 | 15506.0 | 3.263459e+06 |
| Isle of Man | 23099.0 | 9.206400e+04 | 80.0 | 8.541000e+04 |
| Gibraltar | 15632.0 | 8.906400e+04 | 101.0 | 3.369100e+04 |
| Guyana | 62986.0 | 8.656300e+04 | 1222.0 | 7.903290e+05 |
| Liechtenstein | 12165.0 | 7.022800e+04 | 78.0 | 3.825400e+04 |
| Oman | 383389.0 | 6.508100e+04 | 4246.0 | 5.223376e+06 |
| Sweden | 2451464.0 | 4.761600e+04 | 17611.0 | 1.016016e+07 |
| Sudan | 61525.0 | 4.557200e+04 | 3910.0 | 4.490935e+07 |
| Greenland | 11760.0 | 4.333600e+04 | 19.0 | 5.686800e+04 |
| Seychelles | 39408.0 | 4.286300e+04 | 163.0 | 9.891000e+04 |
| Democratic Republic of Congo | 86039.0 | 4.230300e+04 | 1335.0 | 9.237799e+07 |
| Haiti | 30350.0 | 4.145300e+04 | 897.0 | 1.154168e+07 |
| Somalia | 26351.0 | 3.729200e+04 | 1349.0 | 1.635950e+07 |
| Mauritius | 71004.0 | 3.515300e+04 | 786.0 | 1.273428e+06 |
| Faeroe Islands | 34658.0 | 3.481300e+04 | 28.0 | 4.905300e+04 |
| Kuwait | 620980.0 | 3.092700e+04 | 2540.0 | 4.328553e+06 |
| Fiji | 63999.0 | 2.829500e+04 | 836.0 | 9.028990e+05 |
| Saint Lucia | 22729.0 | 2.625500e+04 | 360.0 | 1.844010e+05 |
| Mauritania | 58638.0 | 2.465900e+04 | 979.0 | 4.775110e+06 |
| San Marino | 14435.0 | 2.014100e+04 | 112.0 | 3.401000e+04 |
| Guernsey | 0.0 | 1.593100e+04 | 0.0 | 6.338500e+04 |
| Saint Vincent and the Grenadines | 10045.0 | 1.569000e+04 | 106.0 | 1.112690e+05 |
| Cayman Islands | 19373.0 | 1.533900e+04 | 17.0 | 6.649800e+04 |
| Afghanistan | 174081.0 | 1.374200e+04 | 7617.0 | 3.983543e+07 |
| Madagascar | 63666.0 | 1.354400e+04 | 1366.0 | 2.842733e+07 |
| Central African Republic | 14225.0 | 1.288700e+04 | 113.0 | 4.919987e+06 |
| Botswana | 263950.0 | 1.043500e+04 | 2619.0 | 2.397240e+06 |
| Cameroon | 119240.0 | 1.029000e+04 | 1923.0 | 2.722426e+07 |
| Liberia | 7510.0 | 1.008900e+04 | 294.0 | 5.180208e+06 |
| Iraq | 2305083.0 | 9.985000e+03 | 25013.0 | 4.117935e+07 |
| Bahamas | 33198.0 | 9.258000e+03 | 771.0 | 3.969140e+05 |
| Antigua and Barbuda | 7451.0 | 8.107000e+03 | 135.0 | 9.872800e+04 |
| Sierra Leone | 7665.0 | 7.981000e+03 | 125.0 | 8.141343e+06 |
| Timor | 22732.0 | 7.881000e+03 | 129.0 | 1.343875e+06 |
| South Sudan | 16989.0 | 7.489000e+03 | 137.0 | 1.138138e+07 |
| Cape Verde | 55889.0 | 7.462000e+03 | 402.0 | 5.619010e+05 |
| Saint Kitts and Nevis | 5530.0 | 6.553000e+03 | 42.0 | 5.354600e+04 |
| Dominica | 11142.0 | 6.417000e+03 | 57.0 | 7.217200e+04 |
| Andorra | 38249.0 | 4.802000e+03 | 151.0 | 7.735400e+04 |
| Myanmar | 592139.0 | 3.800000e+03 | 19376.0 | 5.480601e+07 |
| Northern Cyprus | 0.0 | 1.988000e+03 | 0.0 | 1.474690e+08 |
| Guinea-Bissau | 8027.0 | 1.658000e+03 | 167.0 | 2.015490e+06 |
| Congo | 24020.0 | 1.486000e+03 | 409.0 | 5.657017e+06 |
| Gabon | 47543.0 | 1.486000e+03 | 303.0 | 2.278829e+06 |
| Anguilla | 2555.0 | 1.421000e+03 | 10.0 | 1.512500e+04 |
| Grenada | 13707.0 | 1.037000e+03 | 216.0 | 1.130150e+05 |
| French Polynesia | 67660.0 | 8.550000e+02 | 641.0 | 2.825340e+05 |
| Equatorial Guinea | 15885.0 | 6.390000e+02 | 183.0 | 1.449891e+06 |
| Burundi | 38127.0 | 4.600000e+02 | 38.0 | 1.225543e+07 |
| Gambia | 12039.0 | 4.290000e+02 | 365.0 | 2.486937e+06 |
| Nauru | 0.0 | 1.680000e+02 | 0.0 | 1.087300e+04 |
| British Virgin Islands | 6085.0 | 0.000000e+00 | 62.0 | 3.042300e+04 |
| Palau | 3823.0 | 0.000000e+00 | 6.0 | 1.817400e+04 |
| Burkina Faso | 20751.0 | 0.000000e+00 | 375.0 | 2.149710e+07 |
| Tonga | 355.0 | 0.000000e+00 | 0.0 | 1.067590e+05 |
| Tokelau | 0.0 | 0.000000e+00 | 0.0 | 1.368000e+03 |
| Togo | 36808.0 | 0.000000e+00 | 272.0 | 8.478242e+06 |
| Turkmenistan | 0.0 | 0.000000e+00 | 0.0 | 6.117933e+06 |
| Turks and Caicos Islands | 5868.0 | 0.000000e+00 | 36.0 | 3.922600e+04 |
| Tuvalu | 0.0 | 0.000000e+00 | 0.0 | 1.192500e+04 |
| Bonaire Sint Eustatius and Saba | 7599.0 | 0.000000e+00 | 33.0 | 2.644500e+04 |
| Bermuda | 11561.0 | 0.000000e+00 | 123.0 | 6.209200e+04 |
| Lesotho | 32612.0 | 0.000000e+00 | 696.0 | 2.159067e+06 |
| Benin | 26776.0 | 0.000000e+00 | 163.0 | 1.245103e+07 |
| Belarus | 923432.0 | 0.000000e+00 | 6506.0 | 9.442867e+06 |
| Netherlands | 6540294.0 | 0.000000e+00 | 21710.0 | 1.717309e+07 |
| Austria | 2744023.0 | 0.000000e+00 | 14902.0 | 9.043072e+06 |
| Armenia | 420498.0 | 0.000000e+00 | 8495.0 | 2.968128e+06 |
| Nicaragua | 18105.0 | 0.000000e+00 | 225.0 | 6.702379e+06 |
| Vanuatu | 19.0 | 0.000000e+00 | 1.0 | 3.144640e+05 |
| Vatican | 29.0 | 0.000000e+00 | 0.0 | 8.120000e+02 |
| Venezuela | 515582.0 | 0.000000e+00 | 5645.0 | 2.870495e+07 |
| Wallis and Futuna | 454.0 | 0.000000e+00 | 7.0 | 1.109400e+04 |
| Angola | 98746.0 | 0.000000e+00 | 1903.0 | 3.393361e+07 |
| Yemen | 11772.0 | 0.000000e+00 | 2135.0 | 3.049064e+07 |
| Niger | 8763.0 | 0.000000e+00 | 307.0 | 2.513081e+07 |
| New Caledonia | 55503.0 | 0.000000e+00 | 301.0 | 2.882170e+05 |
| Syria | 54744.0 | 0.000000e+00 | 3082.0 | 1.827570e+07 |
| Tanzania | 33620.0 | 0.000000e+00 | 798.0 | 6.149844e+07 |
| Papua New Guinea | 41351.0 | 0.000000e+00 | 638.0 | 9.119005e+06 |
| Saint Helena | 4.0 | 0.000000e+00 | 0.0 | 6.095000e+03 |
| Mali | 30391.0 | 0.000000e+00 | 722.0 | 2.085572e+07 |
| Jersey | 0.0 | 0.000000e+00 | 0.0 | 1.010730e+05 |
| Saint Pierre and Miquelon | 1089.0 | 0.000000e+00 | 1.0 | 5.771000e+03 |
| Marshall Islands | 8.0 | 0.000000e+00 | 0.0 | 5.961800e+04 |
| Samoa | 33.0 | 0.000000e+00 | 0.0 | 2.001440e+05 |
| International | 721.0 | 0.000000e+00 | 15.0 | 1.474690e+08 |
| Sao Tome and Principe | 5934.0 | 0.000000e+00 | 76.0 | 2.233640e+05 |
| Micronesia (country) | 1.0 | 0.000000e+00 | 0.0 | 1.162550e+05 |
| Sint Maarten (Dutch part) | 0.0 | 0.000000e+00 | 0.0 | 4.342100e+04 |
| Slovakia | 2150666.0 | 0.000000e+00 | 18567.0 | 5.449270e+06 |
| Falkland Islands | 115.0 | 0.000000e+00 | 0.0 | 3.528000e+03 |
| Solomon Islands | 7261.0 | 0.000000e+00 | 106.0 | 7.039950e+05 |
| Eritrea | 9705.0 | 0.000000e+00 | 103.0 | 3.601462e+06 |
| Pitcairn | 0.0 | 0.000000e+00 | 0.0 | 4.700000e+01 |
| Niue | 0.0 | 0.000000e+00 | 0.0 | 1.614000e+03 |
| Monaco | 9457.0 | 0.000000e+00 | 54.0 | 3.952000e+04 |
| Costa Rica | 811040.0 | 0.000000e+00 | 8057.0 | 5.139053e+06 |
| Cook Islands | 2.0 | 0.000000e+00 | 0.0 | 1.757200e+04 |
| Comoros | 8033.0 | 0.000000e+00 | 161.0 | 8.884560e+05 |
| Chad | 7257.0 | 0.000000e+00 | 190.0 | 1.691498e+07 |
| Montserrat | 164.0 | 0.000000e+00 | 2.0 | 4.981000e+03 |
| Kiribati | 2953.0 | 0.000000e+00 | 11.0 | 1.213880e+05 |
| Djibouti | 15547.0 | 0.000000e+00 | 189.0 | 1.002197e+06 |
Now we select the desired countries
pd.reset_option('display.max_rows')
selected_countries = ['United Kingdom', 'Taiwan', 'Lithuania', 'Brazil', 'Italy']
df_p2_q3 = df[df['location'].isin(selected_countries)]
df_p2_q3
| iso_code | continent | location | date | total_cases | new_cases | new_cases_smoothed | total_deaths | new_deaths | new_deaths_smoothed | ... | male_smokers | handwashing_facilities | hospital_beds_per_thousand | life_expectancy | human_development_index | excess_mortality_cumulative_absolute | excess_mortality_cumulative | excess_mortality | excess_mortality_cumulative_per_million | shamsi_date | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 21222 | BRA | South America | Brazil | 2020-02-26 | 1.0 | 1.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 17.9 | 50.790872 | 2.20 | 75.88 | 0.765 | -inf | -inf | -inf | -inf | 1398-12-07 |
| 21223 | BRA | South America | Brazil | 2020-02-27 | 1.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 17.9 | 50.790872 | 2.20 | 75.88 | 0.765 | -inf | -inf | -inf | -inf | 1398-12-08 |
| 21224 | BRA | South America | Brazil | 2020-02-28 | 1.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 17.9 | 50.790872 | 2.20 | 75.88 | 0.765 | -inf | -inf | -inf | -inf | 1398-12-09 |
| 21225 | BRA | South America | Brazil | 2020-02-29 | 2.0 | 1.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 17.9 | 50.790872 | 2.20 | 75.88 | 0.765 | 7049.6 | 3.31 | 5.25 | 32.943066 | 1398-12-10 |
| 21226 | BRA | South America | Brazil | 2020-03-01 | 2.0 | 0.0 | 0.000 | 0.0 | 0.0 | 0.000 | ... | 17.9 | 50.790872 | 2.20 | 75.88 | 0.765 | -inf | -inf | -inf | -inf | 1398-12-11 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 156566 | GBR | Europe | United Kingdom | 2022-02-26 | 18854972.0 | 0.0 | 31611.143 | 161367.0 | 0.0 | 103.000 | ... | 24.7 | 50.790872 | 2.54 | 81.32 | 0.932 | -inf | -inf | -inf | -inf | 1400-12-07 |
| 156567 | GBR | Europe | United Kingdom | 2022-02-27 | 18854972.0 | 0.0 | 27181.143 | 161367.0 | 0.0 | 92.429 | ... | 24.7 | 50.790872 | 2.54 | 81.32 | 0.932 | -inf | -inf | -inf | -inf | 1400-12-08 |
| 156568 | GBR | Europe | United Kingdom | 2022-02-28 | 18937085.0 | 82113.0 | 33408.143 | 161504.0 | 137.0 | 107.714 | ... | 24.7 | 50.790872 | 2.54 | 81.32 | 0.932 | -inf | -inf | -inf | -inf | 1400-12-09 |
| 156569 | GBR | Europe | United Kingdom | 2022-03-01 | 19036570.0 | 99485.0 | 41712.714 | 161773.0 | 269.0 | 116.857 | ... | 24.7 | 50.790872 | 2.54 | 81.32 | 0.932 | -inf | -inf | -inf | -inf | 1400-12-10 |
| 156570 | GBR | Europe | United Kingdom | 2022-03-02 | 19081606.0 | 45036.0 | 42455.286 | 161848.0 | 75.0 | 104.000 | ... | 24.7 | 50.790872 | 2.54 | 81.32 | 0.932 | -inf | -inf | -inf | -inf | 1400-12-11 |
3770 rows × 68 columns
First we aggregate country data by gregorian_month in 2021 year, then we will use the scatter plot diagram to check the rate of vaccination.
df_p2_q3['date'] = pd.to_datetime(df_p2_q3['date'])
df_p2_q3 = df_p2_q3 [df_p2_q3 ['date'].dt.year == 2021]
df_p2_q3['gregorian_month'] = df_p2_q3['date'].dt.month
df_p2_q3 = df_p2_q3.groupby(by=['location', "gregorian_month"]).sum()
df_p2_q3.reset_index().pivot('gregorian_month','location','new_vaccinations').plot(title='Vaccination rate', grid=True, figsize=(20, 10),fontsize=15)
/tmp/ipykernel_4500/4185576851.py:1: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy df_p2_q3['date'] = pd.to_datetime(df_p2_q3['date']) /tmp/ipykernel_4500/4185576851.py:3: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy df_p2_q3['gregorian_month'] = df_p2_q3['date'].dt.month
<AxesSubplot:title={'center':'Vaccination rate'}, xlabel='gregorian_month'>
European countries with smaller populations have had almost the same rate of vaccination rates, but countries with larger populations have had their vaccination rates increase over a period of time, but with the advent of new forms of the coronavirus, their vaccination rates have decreased. Less developed countries also have almost constant vaccination rates.
In this section, we examine the strictness trend in the field of corona in Iran. To do this, we use the stringency_index factor.
plt.figure(figsize=(12,8))
ax = sns.scatterplot(df_p1_q7.index, df_p1_q7['stringency_index'], alpha=0.8,)
ax.set_title("Strictness trend in the field of corona in Iran",fontsize=15)
ax.set_xlabel('shamsi month',fontsize=15)
ax.set_ylabel('stringency_index',fontsize=15)
plt.show()
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation. warnings.warn(
Before and after Nowruz, we see the most astrictness, but after a while, the strictness decreases, and then with the arrival of new strains from the corona, we see an increase in strictness.
In this part, we use box function from plotly.express library to draw a Box Plot to characterize the number of death in each country
fig = px.box(df_p1_q2, y='new_deaths')
fig.update_layout(autosize=False, width=800, height=30000,)
fig.show()
pd.set_option('display.max_rows',None)
df_p2_q5 = df_p1_q2.sort_values(by= ['new_deaths'], ascending= [False])
df_p2_q5
| new_cases | new_vaccinations | new_deaths | population | |
|---|---|---|---|---|
| location | ||||
| World | 439011701.0 | 1.122516e+10 | 5946817.0 | 7.874966e+09 |
| Upper middle income | 118212049.0 | 4.804681e+09 | 2421471.0 | 2.513673e+09 |
| High income | 236393139.0 | 2.306054e+09 | 2211971.0 | 1.214930e+09 |
| Europe | 158815550.0 | 1.247823e+09 | 1717056.0 | 7.489630e+08 |
| North America | 93195128.0 | 1.030269e+09 | 1374621.0 | 5.965813e+08 |
| Asia | 117811418.0 | 7.544342e+09 | 1351250.0 | 4.678445e+09 |
| Lower middle income | 82588725.0 | 3.974325e+09 | 1271503.0 | 3.330653e+09 |
| South America | 54222621.0 | 7.462801e+08 | 1247285.0 | 4.342601e+08 |
| European Union | 110033392.0 | 8.184271e+08 | 1015772.0 | 4.471899e+08 |
| United States | 79143715.0 | 5.537498e+08 | 954518.0 | 3.329151e+08 |
| Brazil | 28741413.0 | 3.902730e+08 | 650254.0 | 2.139934e+08 |
| India | 42945160.0 | 1.708969e+09 | 507015.0 | 1.393409e+09 |
| Russia | 16353868.0 | 1.434654e+08 | 346197.0 | 1.459120e+08 |
| Mexico | 5521744.0 | 1.451079e+08 | 311470.0 | 1.302622e+08 |
| Africa | 11230524.0 | 5.818190e+08 | 248668.0 | 1.373486e+09 |
| Peru | 3518721.0 | 6.113136e+07 | 211453.0 | 3.335942e+07 |
| United Kingdom | 18241147.0 | 1.372498e+08 | 160727.0 | 6.820711e+07 |
| Italy | 12868066.0 | 1.343115e+08 | 155245.0 | 6.036747e+07 |
| Indonesia | 5630096.0 | 2.724306e+08 | 149036.0 | 2.763618e+08 |
| Colombia | 6067023.0 | 4.938413e+07 | 138899.0 | 5.126584e+07 |
| France | 23316777.0 | 1.408496e+08 | 138537.0 | 6.742200e+07 |
| Iran | 7066975.0 | 1.673545e+07 | 137267.0 | 8.502876e+07 |
| Argentina | 8912317.0 | 8.251164e+07 | 126390.0 | 4.560582e+07 |
| Germany | 15175471.0 | 1.701530e+08 | 123431.0 | 8.390047e+07 |
| Ukraine | 5040518.0 | 3.168315e+07 | 112459.0 | 4.346682e+07 |
| Poland | 5694767.0 | 3.742697e+07 | 111864.0 | 3.779700e+07 |
| Spain | 11139724.0 | 6.310748e+07 | 100778.0 | 4.674521e+07 |
| South Africa | 3659100.0 | 1.442119e+07 | 99135.0 | 6.004200e+07 |
| Turkey | 13382896.0 | 1.434464e+08 | 94837.0 | 8.504274e+07 |
| Romania | 2748777.0 | 1.665058e+07 | 63668.0 | 1.912777e+07 |
| Philippines | 3663931.0 | 5.494906e+07 | 56506.0 | 1.110469e+08 |
| Hungary | 1793120.0 | 8.276404e+06 | 44134.0 | 9.634162e+06 |
| Chile | 3098110.0 | 4.855777e+07 | 42624.0 | 1.921236e+07 |
| Low income | 1805056.0 | 1.391686e+08 | 41804.0 | 6.651490e+08 |
| Vietnam | 3709481.0 | 1.209025e+08 | 40637.0 | 9.816883e+07 |
| Czechia | 3602844.0 | 1.739288e+07 | 38771.0 | 1.072455e+07 |
| Canada | 3303284.0 | 8.106477e+07 | 36728.0 | 3.806791e+07 |
| Bulgaria | 1096194.0 | 4.143716e+06 | 35696.0 | 6.896655e+06 |
| Malaysia | 3496090.0 | 6.741625e+07 | 32942.0 | 3.277620e+07 |
| Belgium | 3563841.0 | 2.504046e+07 | 30316.0 | 1.163233e+07 |
| Pakistan | 1511754.0 | 8.561347e+07 | 30237.0 | 2.251999e+08 |
| Bangladesh | 1945108.0 | 8.807564e+07 | 29053.0 | 1.663035e+08 |
| Tunisia | 999441.0 | 8.530717e+06 | 27824.0 | 1.193576e+07 |
| Greece | 2454429.0 | 1.907120e+07 | 25972.0 | 1.037075e+07 |
| Iraq | 2305083.0 | 9.985000e+03 | 25013.0 | 4.117935e+07 |
| Japan | 5143816.0 | 1.667069e+08 | 24140.0 | 1.260508e+08 |
| Egypt | 486381.0 | 2.078777e+06 | 24132.0 | 1.042583e+08 |
| Thailand | 2958176.0 | 1.087844e+08 | 23072.0 | 6.995084e+07 |
| Ecuador | 844764.0 | 3.131789e+07 | 22611.0 | 1.788847e+07 |
| Netherlands | 6540294.0 | 0.000000e+00 | 21710.0 | 1.717309e+07 |
| Bolivia | 893775.0 | 1.258651e+07 | 21443.0 | 1.183294e+07 |
| Portugal | 3282618.0 | 1.964667e+07 | 21111.0 | 1.016792e+07 |
| Myanmar | 592139.0 | 3.800000e+03 | 19376.0 | 5.480601e+07 |
| Kazakhstan | 1450652.0 | 1.870224e+07 | 19239.0 | 1.899496e+07 |
| Slovakia | 2150666.0 | 0.000000e+00 | 18567.0 | 5.449270e+06 |
| Paraguay | 642573.0 | 4.105501e+06 | 18422.0 | 7.219641e+06 |
| Sweden | 2451464.0 | 4.761600e+04 | 17611.0 | 1.016016e+07 |
| Guatemala | 784024.0 | 1.341083e+07 | 17021.0 | 1.824987e+07 |
| Sri Lanka | 647699.0 | 3.284874e+07 | 16267.0 | 2.149731e+07 |
| Georgia | 1616159.0 | 1.413257e+06 | 16231.0 | 3.979773e+06 |
| Morocco | 1161290.0 | 2.740605e+07 | 16002.0 | 3.734479e+07 |
| Bosnia and Herzegovina | 371553.0 | 9.386200e+04 | 15506.0 | 3.263459e+06 |
| Serbia | 1916707.0 | 3.257010e+06 | 15318.0 | 6.871547e+06 |
| Croatia | 1058453.0 | 3.677004e+06 | 15122.0 | 4.081657e+06 |
| Austria | 2744023.0 | 0.000000e+00 | 14902.0 | 9.043072e+06 |
| Jordan | 1638338.0 | 4.260392e+06 | 13849.0 | 1.026902e+07 |
| Switzerland | 2842412.0 | 1.556814e+07 | 13269.0 | 8.715494e+06 |
| Nepal | 977200.0 | 9.492136e+06 | 11941.0 | 2.967492e+07 |
| Honduras | 412753.0 | 2.290260e+05 | 10779.0 | 1.006299e+07 |
| Moldova | 502956.0 | 1.305637e+06 | 10657.0 | 4.024025e+06 |
| Israel | 3652454.0 | 1.801561e+07 | 10245.0 | 9.291000e+06 |
| Lebanon | 1072537.0 | 4.755512e+06 | 10115.0 | 6.769151e+06 |
| Azerbaijan | 787367.0 | 1.023182e+07 | 9454.0 | 1.022334e+07 |
| North Macedonia | 298195.0 | 9.505510e+05 | 9036.0 | 2.082661e+06 |
| Saudi Arabia | 746066.0 | 5.737721e+07 | 9002.0 | 3.534068e+07 |
| Cuba | 1070730.0 | 3.065243e+07 | 8497.0 | 1.131750e+07 |
| Armenia | 420498.0 | 0.000000e+00 | 8495.0 | 2.968128e+06 |
| Lithuania | 913223.0 | 4.449324e+06 | 8442.0 | 2.689862e+06 |
| South Korea | 3691487.0 | 1.192514e+08 | 8394.0 | 5.130518e+07 |
| Panama | 756085.0 | 5.934725e+06 | 8098.0 | 4.381583e+06 |
| Costa Rica | 811040.0 | 0.000000e+00 | 8057.0 | 5.139053e+06 |
| Oceania | 3735739.0 | 7.462766e+07 | 7922.0 | 4.321995e+07 |
| Afghanistan | 174081.0 | 1.374200e+04 | 7617.0 | 3.983543e+07 |
| Ethiopia | 468786.0 | 2.131937e+07 | 7467.0 | 1.178762e+08 |
| Uruguay | 846889.0 | 7.622054e+06 | 7005.0 | 3.485152e+06 |
| Algeria | 265079.0 | 1.707860e+05 | 6843.0 | 4.461663e+07 |
| Ireland | 1315500.0 | 1.056764e+07 | 6540.0 | 4.982904e+06 |
| Belarus | 923432.0 | 0.000000e+00 | 6506.0 | 9.442867e+06 |
| Slovenia | 897040.0 | 2.956720e+06 | 6327.0 | 2.078723e+06 |
| Libya | 495972.0 | 1.416880e+05 | 6279.0 | 6.958538e+06 |
| Venezuela | 515582.0 | 0.000000e+00 | 5645.0 | 2.870495e+07 |
| Kenya | 323002.0 | 1.141772e+07 | 5640.0 | 5.498570e+07 |
| Palestine | 648039.0 | 1.655605e+06 | 5532.0 | 5.222756e+06 |
| Zimbabwe | 237509.0 | 7.080893e+06 | 5396.0 | 1.509217e+07 |
| Australia | 3326214.0 | 5.379783e+07 | 5319.0 | 2.578822e+07 |
| Latvia | 673218.0 | 2.855540e+06 | 5284.0 | 1.866934e+06 |
| China | 109423.0 | 3.061013e+09 | 4640.0 | 1.444216e+09 |
| Denmark | 2805858.0 | 1.317204e+07 | 4633.0 | 5.813302e+06 |
| Dominican Republic | 575157.0 | 1.331425e+07 | 4370.0 | 1.095371e+07 |
| Oman | 383389.0 | 6.508100e+04 | 4246.0 | 5.223376e+06 |
| El Salvador | 156456.0 | 4.886767e+06 | 4077.0 | 6.518500e+06 |
| Namibia | 157275.0 | 2.347090e+05 | 4010.0 | 2.587344e+06 |
| Zambia | 313203.0 | 1.321156e+06 | 3955.0 | 1.892066e+07 |
| Sudan | 61525.0 | 4.557200e+04 | 3910.0 | 4.490935e+07 |
| Trinidad and Tobago | 128691.0 | 1.503347e+06 | 3637.0 | 1.403374e+06 |
| Uganda | 163447.0 | 7.200770e+05 | 3594.0 | 4.712353e+07 |
| Albania | 271825.0 | 1.415150e+06 | 3474.0 | 2.872934e+06 |
| Kyrgyzstan | 200556.0 | 2.076513e+06 | 3403.0 | 6.628347e+06 |
| Nigeria | 254598.0 | 3.160328e+06 | 3143.0 | 2.114007e+08 |
| Kosovo | 226392.0 | 1.330147e+06 | 3116.0 | 1.782115e+06 |
| Syria | 54744.0 | 0.000000e+00 | 3082.0 | 1.827570e+07 |
| Cambodia | 131004.0 | 3.467897e+07 | 3032.0 | 1.694645e+07 |
| Jamaica | 128079.0 | 4.916840e+05 | 2814.0 | 2.973462e+06 |
| Montenegro | 230512.0 | 5.963530e+05 | 2683.0 | 6.280510e+05 |
| Botswana | 263950.0 | 1.043500e+04 | 2619.0 | 2.397240e+06 |
| Malawi | 85362.0 | 1.267776e+06 | 2617.0 | 1.964768e+07 |
| Kuwait | 620980.0 | 3.092700e+04 | 2540.0 | 4.328553e+06 |
| Finland | 658559.0 | 1.235072e+06 | 2381.0 | 5.548361e+06 |
| United Arab Emirates | 880970.0 | 2.018434e+07 | 2301.0 | 9.991083e+06 |
| Estonia | 504148.0 | 1.955946e+06 | 2268.0 | 1.325188e+06 |
| Mozambique | 225096.0 | 2.958120e+05 | 2227.0 | 3.216304e+07 |
| Mongolia | 909379.0 | 4.407760e+06 | 2171.0 | 3.329282e+06 |
| Yemen | 11772.0 | 0.000000e+00 | 2135.0 | 3.049064e+07 |
| Senegal | 85712.0 | 3.485540e+05 | 1960.0 | 1.719631e+07 |
| Cameroon | 119240.0 | 1.029000e+04 | 1923.0 | 2.722426e+07 |
| Angola | 98746.0 | 0.000000e+00 | 1903.0 | 3.393361e+07 |
| Norway | 1279169.0 | 1.123317e+07 | 1666.0 | 5.465629e+06 |
| Uzbekistan | 236596.0 | 1.512707e+07 | 1637.0 | 3.393576e+07 |
| Bahrain | 519584.0 | 2.927653e+06 | 1511.0 | 1.748295e+06 |
| Rwanda | 129533.0 | 9.206440e+05 | 1457.0 | 1.327652e+07 |
| Ghana | 159891.0 | 1.809500e+05 | 1442.0 | 3.173213e+07 |
| Eswatini | 69211.0 | 1.107650e+05 | 1390.0 | 1.172369e+06 |
| Madagascar | 63666.0 | 1.354400e+04 | 1366.0 | 2.842733e+07 |
| Somalia | 26351.0 | 3.729200e+04 | 1349.0 | 1.635950e+07 |
| Democratic Republic of Congo | 86039.0 | 4.230300e+04 | 1335.0 | 9.237799e+07 |
| Suriname | 78353.0 | 3.429360e+05 | 1317.0 | 5.917980e+05 |
| Guyana | 62986.0 | 8.656300e+04 | 1222.0 | 7.903290e+05 |
| Hong Kong | 293754.0 | 1.302273e+07 | 1168.0 | 7.552800e+06 |
| Singapore | 767663.0 | 1.357254e+07 | 1040.0 | 5.453600e+06 |
| Luxembourg | 186210.0 | 1.178840e+06 | 995.0 | 6.348140e+05 |
| Mauritania | 58638.0 | 2.465900e+04 | 979.0 | 4.775110e+06 |
| Haiti | 30350.0 | 4.145300e+04 | 897.0 | 1.154168e+07 |
| Cyprus | 326611.0 | 4.282040e+05 | 859.0 | 8.960050e+05 |
| Taiwan | 20584.0 | 3.695129e+07 | 853.0 | 2.385501e+07 |
| Fiji | 63999.0 | 2.829500e+04 | 836.0 | 9.028990e+05 |
| Tanzania | 33620.0 | 0.000000e+00 | 798.0 | 6.149844e+07 |
| Cote d'Ivoire | 81552.0 | 2.285727e+06 | 794.0 | 2.705363e+07 |
| Mauritius | 71004.0 | 3.515300e+04 | 786.0 | 1.273428e+06 |
| Bahamas | 33198.0 | 9.258000e+03 | 771.0 | 3.969140e+05 |
| Mali | 30391.0 | 0.000000e+00 | 722.0 | 2.085572e+07 |
| Lesotho | 32612.0 | 0.000000e+00 | 696.0 | 2.159067e+06 |
| Qatar | 357583.0 | 5.106175e+06 | 670.0 | 2.930524e+06 |
| Belize | 56816.0 | 1.226920e+05 | 654.0 | 4.049150e+05 |
| French Polynesia | 67660.0 | 8.550000e+02 | 641.0 | 2.825340e+05 |
| Papua New Guinea | 41351.0 | 0.000000e+00 | 638.0 | 9.119005e+06 |
| Laos | 143240.0 | 1.802450e+06 | 623.0 | 7.379358e+06 |
| Malta | 71497.0 | 1.205547e+06 | 608.0 | 5.161000e+05 |
| Guinea | 36397.0 | 1.586407e+06 | 440.0 | 1.349724e+07 |
| Congo | 24020.0 | 1.486000e+03 | 409.0 | 5.657017e+06 |
| Cape Verde | 55889.0 | 7.462000e+03 | 402.0 | 5.619010e+05 |
| Burkina Faso | 20751.0 | 0.000000e+00 | 375.0 | 2.149710e+07 |
| Gambia | 12039.0 | 4.290000e+02 | 365.0 | 2.486937e+06 |
| Saint Lucia | 22729.0 | 2.625500e+04 | 360.0 | 1.844010e+05 |
| Barbados | 55543.0 | 2.868630e+05 | 316.0 | 2.877080e+05 |
| Niger | 8763.0 | 0.000000e+00 | 307.0 | 2.513081e+07 |
| Gabon | 47543.0 | 1.486000e+03 | 303.0 | 2.278829e+06 |
| New Caledonia | 55503.0 | 0.000000e+00 | 301.0 | 2.882170e+05 |
| Maldives | 171114.0 | 7.707100e+05 | 297.0 | 5.436200e+05 |
| Liberia | 7510.0 | 1.008900e+04 | 294.0 | 5.180208e+06 |
| Togo | 36808.0 | 0.000000e+00 | 272.0 | 8.478242e+06 |
| Curacao | 39016.0 | 1.840890e+05 | 261.0 | 1.647960e+05 |
| Nicaragua | 18105.0 | 0.000000e+00 | 225.0 | 6.702379e+06 |
| Grenada | 13707.0 | 1.037000e+03 | 216.0 | 1.130150e+05 |
| Aruba | 33684.0 | 1.091530e+05 | 212.0 | 1.071950e+05 |
| Chad | 7257.0 | 0.000000e+00 | 190.0 | 1.691498e+07 |
| Djibouti | 15547.0 | 0.000000e+00 | 189.0 | 1.002197e+06 |
| Equatorial Guinea | 15885.0 | 6.390000e+02 | 183.0 | 1.449891e+06 |
| Guinea-Bissau | 8027.0 | 1.658000e+03 | 167.0 | 2.015490e+06 |
| Benin | 26776.0 | 0.000000e+00 | 163.0 | 1.245103e+07 |
| Seychelles | 39408.0 | 4.286300e+04 | 163.0 | 9.891000e+04 |
| Comoros | 8033.0 | 0.000000e+00 | 161.0 | 8.884560e+05 |
| Andorra | 38249.0 | 4.802000e+03 | 151.0 | 7.735400e+04 |
| South Sudan | 16989.0 | 7.489000e+03 | 137.0 | 1.138138e+07 |
| Antigua and Barbuda | 7451.0 | 8.107000e+03 | 135.0 | 9.872800e+04 |
| Timor | 22732.0 | 7.881000e+03 | 129.0 | 1.343875e+06 |
| Brunei | 71667.0 | 2.627530e+05 | 129.0 | 4.415320e+05 |
| Sierra Leone | 7665.0 | 7.981000e+03 | 125.0 | 8.141343e+06 |
| Tajikistan | 17786.0 | 1.247450e+05 | 125.0 | 9.749625e+06 |
| Bermuda | 11561.0 | 0.000000e+00 | 123.0 | 6.209200e+04 |
| Central African Republic | 14225.0 | 1.288700e+04 | 113.0 | 4.919987e+06 |
| San Marino | 14435.0 | 2.014100e+04 | 112.0 | 3.401000e+04 |
| Solomon Islands | 7261.0 | 0.000000e+00 | 106.0 | 7.039950e+05 |
| Saint Vincent and the Grenadines | 10045.0 | 1.569000e+04 | 106.0 | 1.112690e+05 |
| Eritrea | 9705.0 | 0.000000e+00 | 103.0 | 3.601462e+06 |
| Gibraltar | 15632.0 | 8.906400e+04 | 101.0 | 3.369100e+04 |
| Isle of Man | 23099.0 | 9.206400e+04 | 80.0 | 8.541000e+04 |
| Liechtenstein | 12165.0 | 7.022800e+04 | 78.0 | 3.825400e+04 |
| Sao Tome and Principe | 5934.0 | 0.000000e+00 | 76.0 | 2.233640e+05 |
| Iceland | 135748.0 | 2.588510e+05 | 66.0 | 3.687920e+05 |
| British Virgin Islands | 6085.0 | 0.000000e+00 | 62.0 | 3.042300e+04 |
| Dominica | 11142.0 | 6.417000e+03 | 57.0 | 7.217200e+04 |
| New Zealand | 166103.0 | 1.067335e+07 | 56.0 | 5.126300e+06 |
| Monaco | 9457.0 | 0.000000e+00 | 54.0 | 3.952000e+04 |
| Saint Kitts and Nevis | 5530.0 | 6.553000e+03 | 42.0 | 5.354600e+04 |
| Burundi | 38127.0 | 4.600000e+02 | 38.0 | 1.225543e+07 |
| Turks and Caicos Islands | 5868.0 | 0.000000e+00 | 36.0 | 3.922600e+04 |
| Bonaire Sint Eustatius and Saba | 7599.0 | 0.000000e+00 | 33.0 | 2.644500e+04 |
| Faeroe Islands | 34658.0 | 3.481300e+04 | 28.0 | 4.905300e+04 |
| Greenland | 11760.0 | 4.333600e+04 | 19.0 | 5.686800e+04 |
| Cayman Islands | 19373.0 | 1.533900e+04 | 17.0 | 6.649800e+04 |
| International | 721.0 | 0.000000e+00 | 15.0 | 1.474690e+08 |
| Kiribati | 2953.0 | 0.000000e+00 | 11.0 | 1.213880e+05 |
| Anguilla | 2555.0 | 1.421000e+03 | 10.0 | 1.512500e+04 |
| Wallis and Futuna | 454.0 | 0.000000e+00 | 7.0 | 1.109400e+04 |
| Palau | 3823.0 | 0.000000e+00 | 6.0 | 1.817400e+04 |
| Bhutan | 13535.0 | 8.620330e+05 | 6.0 | 7.799000e+05 |
| Montserrat | 164.0 | 0.000000e+00 | 2.0 | 4.981000e+03 |
| Vanuatu | 19.0 | 0.000000e+00 | 1.0 | 3.144640e+05 |
| Saint Pierre and Miquelon | 1089.0 | 0.000000e+00 | 1.0 | 5.771000e+03 |
| Northern Cyprus | 0.0 | 1.988000e+03 | 0.0 | 1.474690e+08 |
| Guernsey | 0.0 | 1.593100e+04 | 0.0 | 6.338500e+04 |
| Cook Islands | 2.0 | 0.000000e+00 | 0.0 | 1.757200e+04 |
| Vatican | 29.0 | 0.000000e+00 | 0.0 | 8.120000e+02 |
| Micronesia (country) | 1.0 | 0.000000e+00 | 0.0 | 1.162550e+05 |
| Jersey | 0.0 | 0.000000e+00 | 0.0 | 1.010730e+05 |
| Tuvalu | 0.0 | 0.000000e+00 | 0.0 | 1.192500e+04 |
| Turkmenistan | 0.0 | 0.000000e+00 | 0.0 | 6.117933e+06 |
| Nauru | 0.0 | 1.680000e+02 | 0.0 | 1.087300e+04 |
| Pitcairn | 0.0 | 0.000000e+00 | 0.0 | 4.700000e+01 |
| Tonga | 355.0 | 0.000000e+00 | 0.0 | 1.067590e+05 |
| Tokelau | 0.0 | 0.000000e+00 | 0.0 | 1.368000e+03 |
| Falkland Islands | 115.0 | 0.000000e+00 | 0.0 | 3.528000e+03 |
| Saint Helena | 4.0 | 0.000000e+00 | 0.0 | 6.095000e+03 |
| Macao | 81.0 | 6.627460e+05 | 0.0 | 6.583910e+05 |
| Samoa | 33.0 | 0.000000e+00 | 0.0 | 2.001440e+05 |
| Sint Maarten (Dutch part) | 0.0 | 0.000000e+00 | 0.0 | 4.342100e+04 |
| Marshall Islands | 8.0 | 0.000000e+00 | 0.0 | 5.961800e+04 |
| Niue | 0.0 | 0.000000e+00 | 0.0 | 1.614000e+03 |
Based on the box plot, South America, United States ,Brazil ,India ,Russia ,Mexico ,Africa and Peru are outlying countries and we remove them from our data for analysis
pd.reset_option('display.max_rows')
print("median: ", 2284.5)
print("average:", df_p1_q2['new_deaths'].mean())
median: 2284.5 average: 104214.1050420168
According to the median and average values, the skewness of the boxplot is downwards
In this section, we use scatterplot to analysis features impact
df_p2_q6 = df[["location", "new_cases", "new_deaths"]]
df_p2_q6 = df_p2_q6.groupby(by="location").sum()
df_p2_q6_p = df[["location", "population_density", "median_age", "handwashing_facilities",
"hospital_beds_per_thousand", "human_development_index"]]
df_p2_q6_p = df_p2_q6_p.groupby(by="location").max()
df_p2_q6 = df_p2_q6.join(df_p2_q6_p)
df_p2_q6
| new_cases | new_deaths | population_density | median_age | handwashing_facilities | hospital_beds_per_thousand | human_development_index | |
|---|---|---|---|---|---|---|---|
| location | |||||||
| Afghanistan | 174081.0 | 7617.0 | 54.422000 | 18.600000 | 37.746000 | 0.500000 | 0.511000 |
| Africa | 11230524.0 | 248668.0 | 464.408404 | 30.568558 | 50.790872 | 3.027939 | 0.725595 |
| Albania | 271825.0 | 3474.0 | 104.871000 | 38.000000 | 50.790872 | 2.890000 | 0.795000 |
| Algeria | 265079.0 | 6843.0 | 17.348000 | 29.100000 | 83.741000 | 1.900000 | 0.748000 |
| Andorra | 38249.0 | 151.0 | 163.755000 | 30.568558 | 50.790872 | 3.027939 | 0.868000 |
| ... | ... | ... | ... | ... | ... | ... | ... |
| Wallis and Futuna | 454.0 | 7.0 | 464.408404 | 30.568558 | 50.790872 | 3.027939 | 0.725595 |
| World | 439011701.0 | 5946817.0 | 58.045000 | 30.900000 | 60.130000 | 2.705000 | 0.737000 |
| Yemen | 11772.0 | 2135.0 | 53.508000 | 20.300000 | 49.542000 | 0.700000 | 0.470000 |
| Zambia | 313203.0 | 3955.0 | 22.995000 | 17.700000 | 13.938000 | 2.000000 | 0.584000 |
| Zimbabwe | 237509.0 | 5396.0 | 42.729000 | 19.600000 | 36.791000 | 1.700000 | 0.571000 |
238 rows × 7 columns
for i in ["new_deaths", "new_cases"]:
for j in ["population_density", "median_age", "handwashing_facilities",
"hospital_beds_per_thousand", "human_development_index"]:
plt.figure(figsize=(12,8))
ax = sns.scatterplot(df_p2_q6[j], df_p2_q6[i], alpha=0.8,)
_title = "The effect of " + j + " on the " + i
ax.set_title(_title,fontsize=15)
ax.set_xlabel(j,fontsize=15)
ax.set_ylabel(i,fontsize=15)
plt.show()
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
According to the plotted diagrams, the population_density feature and the median_age, handwashing_facilities, hospital_beds_per_thousand, human_development_index features have almost the same effect on the new_deaths, new_cases features.
In this section, we examine the relationship between the economic situation of countries and the number of people vaccinated.
df_p2_q7 = df[["location", 'gdp_per_capita']]
df_p2_q7 = df_p2_q7.groupby(by="location").max()
df_p2_q7 = df_p1_q2.join(df_p2_q7)
plt.figure(figsize=(12,8))
ax = sns.scatterplot(df_p2_q7['gdp_per_capita'], df_p2_q7['new_vaccinations'])
ax.set_title("The relationship between the economic status of countries and the number of people vaccinated",fontsize=12)
ax.set_xlabel('gdp_per_capita',fontsize=15)
ax.set_ylabel('new_vaccinations',fontsize=15)
plt.show()
/home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
Countries with a more stable economic situation have more people vaccinated.
In this part, we examine the distribution of the number of patients by month in 2021
df['date'] = pd.to_datetime(df['date'])
df_p2_q8 = df[df['date'].dt.year == 2021]
df_p2_q8['gregorian_month'] = df_p2_q8['date'].dt.month
df_p2_q8 = df_p2_q8[['gregorian_month', 'new_cases']]
df_p2_q8 = df_p2_q8.groupby(by="gregorian_month").sum()
plt.figure(figsize=(12,8))
ax = sns.scatterplot(df_p2_q8.index, df_p2_q8['new_cases'], alpha=0.8)
ax.set_title('Distribution of the number of patients by month in 2021',fontsize=15)
ax.set_xlabel('gregorian month',fontsize=15)
ax.set_ylabel('new_cases',fontsize=15)
plt.show()
/tmp/ipykernel_4500/2888721197.py:3: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy /home/mohammad/.local/lib/python3.9/site-packages/seaborn/_decorators.py:36: FutureWarning: Pass the following variables as keyword args: x, y. From version 0.12, the only valid positional argument will be `data`, and passing other arguments without an explicit keyword will result in an error or misinterpretation.
It can almost be said that the distribution of patients by month has a sinusoidal trend and according to the global corona situation such as new forms of corona and the amount of vaccination, the number of patients per month changes and there is no definite trend.
In this part, we show the number of deaths of the last three months in different countries in relation to their population on a map. To do this, we use the geopandas library
df_p3_q1 = df[['location', 'new_deaths', 'population', 'date']]
df_p3_q1 = df_p3_q1.sort_values(by = "date",ascending = True).set_index("date").last("3M")
df_p3_q1 = df_p3_q1.reset_index()
df_p3_q1_p1 = df_p3_q1[["location", "new_deaths"]]
df_p3_q1_p1 = df_p3_q1_p1.groupby(by="location").sum()
df_p3_q1_p2 = df_p3_q1[["location", "population"]]
df_p3_q1_p2 = df_p3_q1_p2.groupby(by="location").max()
df_p3_q1 = df_p3_q1_p1.join(df_p3_q1_p2)
df_p3_q1['deaths_per_population'] = df_p3_q1['new_deaths'] / df_p3_q1['population']
df_p3_q1 = df_p3_q1.drop(['new_deaths', 'population'], axis=1)
df_p3_q1 = df_p3_q1.reset_index()
df_p3_q1
| location | deaths_per_population | |
|---|---|---|
| 0 | Afghanistan | 0.000007 |
| 1 | Africa | 0.000015 |
| 2 | Albania | 0.000089 |
| 3 | Algeria | 0.000013 |
| 4 | Andorra | 0.000142 |
| ... | ... | ... |
| 227 | Wallis and Futuna | 0.000000 |
| 228 | World | 0.000067 |
| 229 | Yemen | 0.000005 |
| 230 | Zambia | 0.000012 |
| 231 | Zimbabwe | 0.000026 |
232 rows × 2 columns
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
world.columns = ['pop_est', 'continent', 'name', 'CODE', 'gdp_md_est', 'geometry']
df_p3_q1 = df_p3_q1.rename(columns = {"location": "name"})
merge = pd.merge(world, df_p3_q1, on = 'name')
merge.plot(column = 'deaths_per_population', figsize = (25, 10), legend = True, cmap ='cubehelix') # cubehelix winter coolwarm
plt.title('The number of deaths of the last 3 months in different countries in relation to their population',fontsize=22)
plt.show()
In this section, we add the number of deaths and the number of vaccinated in Iran on a weekly basis. Then, we draw in a suitable diagram.
df_iran['date'] = pd.to_datetime(df_iran['date'])
df_iran['week_number'] = df_iran['date'].dt.week
df_p3_q2_y2020 = df_iran[df_iran['date'].dt.year == 2020]
df_p3_q2_y2020 = df_p3_q2_y2020[['week_number', 'new_deaths', 'new_vaccinations']]
df_p3_q2_y2020 = df_p3_q2_y2020.groupby(by="week_number").sum()
df_p3_q2_y2021 = df_iran[df_iran['date'].dt.year == 2021]
df_p3_q2_y2021 = df_p3_q2_y2021[['week_number', 'new_deaths', 'new_vaccinations']]
df_p3_q2_y2021 = df_p3_q2_y2021.groupby(by="week_number").sum()
df_p3_q2_y2022 = df_iran[df_iran['date'].dt.year == 2022]
df_p3_q2_y2022 = df_p3_q2_y2022[['week_number', 'new_deaths', 'new_vaccinations']]
df_p3_q2_y2022 = df_p3_q2_y2022.groupby(by="week_number").sum()
/tmp/ipykernel_4500/4168250913.py:1: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy /tmp/ipykernel_4500/4168250913.py:2: FutureWarning: Series.dt.weekofyear and Series.dt.week have been deprecated. Please use Series.dt.isocalendar().week instead. /tmp/ipykernel_4500/4168250913.py:2: SettingWithCopyWarning: A value is trying to be set on a copy of a slice from a DataFrame. Try using .loc[row_indexer,col_indexer] = value instead See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df_p3_q2_y2020
| new_deaths | new_vaccinations | |
|---|---|---|
| week_number | ||
| 8 | 8.0 | 0.0 |
| 9 | 46.0 | 0.0 |
| 10 | 140.0 | 0.0 |
| 11 | 530.0 | 0.0 |
| 12 | 961.0 | 0.0 |
| 13 | 955.0 | 0.0 |
| 14 | 963.0 | 0.0 |
| 15 | 871.0 | 0.0 |
| 16 | 644.0 | 0.0 |
| 17 | 592.0 | 0.0 |
| 18 | 493.0 | 0.0 |
| 19 | 437.0 | 0.0 |
| 20 | 348.0 | 0.0 |
| 21 | 429.0 | 0.0 |
| 22 | 380.0 | 0.0 |
| 23 | 484.0 | 0.0 |
| 24 | 556.0 | 0.0 |
| 25 | 786.0 | 0.0 |
| 26 | 885.0 | 0.0 |
| 27 | 1063.0 | 0.0 |
| 28 | 1258.0 | 0.0 |
| 29 | 1359.0 | 0.0 |
| 30 | 1512.0 | 0.0 |
| 31 | 1490.0 | 0.0 |
| 32 | 1237.0 | 0.0 |
| 33 | 1212.0 | 0.0 |
| 34 | 1004.0 | 0.0 |
| 35 | 819.0 | 0.0 |
| 36 | 831.0 | 0.0 |
| 37 | 864.0 | 0.0 |
| 38 | 1144.0 | 0.0 |
| 39 | 1288.0 | 0.0 |
| 40 | 1368.0 | 0.0 |
| 41 | 1587.0 | 0.0 |
| 42 | 1831.0 | 0.0 |
| 43 | 2241.0 | 0.0 |
| 44 | 2682.0 | 0.0 |
| 45 | 2993.0 | 0.0 |
| 46 | 3202.0 | 0.0 |
| 47 | 3309.0 | 0.0 |
| 48 | 3072.0 | 0.0 |
| 49 | 2436.0 | 0.0 |
| 50 | 1886.0 | 0.0 |
| 51 | 1429.0 | 0.0 |
| 52 | 1068.0 | 0.0 |
| 53 | 530.0 | 0.0 |
df_p3_q2_y2021
| new_deaths | new_vaccinations | |
|---|---|---|
| week_number | ||
| 1 | 631.0 | 0.0 |
| 2 | 632.0 | 0.0 |
| 3 | 580.0 | 0.0 |
| 4 | 576.0 | 0.0 |
| 5 | 510.0 | 0.0 |
| 6 | 476.0 | 3000.0 |
| 7 | 538.0 | 0.0 |
| 8 | 590.0 | 0.0 |
| 9 | 614.0 | 0.0 |
| 10 | 543.0 | 0.0 |
| 11 | 567.0 | 0.0 |
| 12 | 600.0 | 0.0 |
| 13 | 763.0 | 0.0 |
| 14 | 1330.0 | 0.0 |
| 15 | 2242.0 | 0.0 |
| 16 | 2842.0 | 71691.0 |
| 17 | 2910.0 | 129369.0 |
| 18 | 2426.0 | 0.0 |
| 19 | 2026.0 | 0.0 |
| 20 | 1661.0 | 0.0 |
| 21 | 1342.0 | 0.0 |
| 22 | 1124.0 | 0.0 |
| 23 | 1035.0 | 0.0 |
| 24 | 867.0 | 0.0 |
| 25 | 880.0 | 0.0 |
| 26 | 947.0 | 0.0 |
| 27 | 1067.0 | 0.0 |
| 28 | 1302.0 | 0.0 |
| 29 | 1639.0 | 0.0 |
| 30 | 2196.0 | 0.0 |
| 31 | 3019.0 | 0.0 |
| 32 | 3813.0 | 0.0 |
| 33 | 4210.0 | 0.0 |
| 34 | 4444.0 | 0.0 |
| 35 | 4192.0 | 881127.0 |
| 36 | 3637.0 | 0.0 |
| 37 | 2871.0 | 1706088.0 |
| 38 | 2178.0 | 0.0 |
| 39 | 1749.0 | 0.0 |
| 40 | 1483.0 | 0.0 |
| 41 | 1483.0 | 0.0 |
| 42 | 1148.0 | 0.0 |
| 43 | 1080.0 | 0.0 |
| 44 | 996.0 | 0.0 |
| 45 | 868.0 | 0.0 |
| 46 | 789.0 | 0.0 |
| 47 | 673.0 | 171719.0 |
| 48 | 571.0 | 0.0 |
| 49 | 522.0 | 0.0 |
| 50 | 361.0 | 0.0 |
| 51 | 317.0 | 0.0 |
| 52 | 206.0 | 0.0 |
| 53 | 317.0 | 0.0 |
df_p3_q2_y2022
| new_deaths | new_vaccinations | |
|---|---|---|
| week_number | ||
| 1 | 198.0 | 0.0 |
| 2 | 197.0 | 1002481.0 |
| 3 | 155.0 | 2102200.0 |
| 4 | 194.0 | 1287747.0 |
| 5 | 406.0 | 3647420.0 |
| 6 | 888.0 | 2395218.0 |
| 7 | 1322.0 | 1281422.0 |
| 8 | 1591.0 | 1366710.0 |
| 9 | 636.0 | 689254.0 |
| 52 | 74.0 | 0.0 |
df_p3_q2_y2020.plot(y=['new_deaths', 'new_vaccinations'], kind="bar", figsize=(50,30),fontsize=25)
df_p3_q2_y2021.plot(y=['new_deaths', 'new_vaccinations'], kind="bar", figsize=(50,30),fontsize=25)
df_p3_q2_y2022.plot(y=['new_deaths', 'new_vaccinations'], kind="bar", figsize=(50,30),fontsize=25)
<AxesSubplot:xlabel='week_number'>
ax1 = df_p3_q2_y2020.plot(y="new_deaths", kind="bar")
ax1.set_title("new deaths & new vaccinations in different weeks of 2020",fontsize=35)
ax1.set_xlabel('Week Number',fontsize=35)
ax1.set_ylabel('Number',fontsize=35)
df_p3_q2_y2020.plot(y='new_vaccinations', kind="bar", ax=ax1, color="C2", figsize=(50,30),fontsize=25)
ax2 = df_p3_q2_y2021.plot(y="new_deaths", kind="bar")
ax2.set_title("new deaths & new vaccinations in different weeks of 2021",fontsize=35)
ax2.set_xlabel('Week Number',fontsize=35)
ax2.set_ylabel('Number',fontsize=35)
df_p3_q2_y2021.plot(y='new_vaccinations', kind="bar", ax=ax2, color="C2", figsize=(50,30),fontsize=25)
ax3 = df_p3_q2_y2022.plot(y="new_deaths", kind="bar")
ax3.set_title("new deaths & new vaccinations in different weeks of 2022",fontsize=35)
ax3.set_xlabel('Week Number',fontsize=35)
ax3.set_ylabel('Number',fontsize=35)
df_p3_q2_y2022.plot(y='new_vaccinations', kind="bar", ax=ax3, color="C2", figsize=(50,30),fontsize=25)
plt.show()
According to the graphs, it can be concluded that in some special weeks, with the arrival of the new corona wave and due to the low rate of vaccination or non-vaccination, especially in the first year of corona arrival, the number of deaths increased and in other weeks due to inhibition relative coronavirus and increased vaccination, we see fewer deaths.